Skip to content

Instantly share code, notes, and snippets.

@pdl
pdl / ack-blame
Last active April 10, 2017 10:18
ack plus git blame
# ack Module::Load --output='@{[`git blame $_[1] -L $.,$. | perl -e "chomp and print while <STDIN>"`]}'
alias ack-blame="ack --output='@{[\`git blame \$_[1] -L \$.,\$. | perl -e \"chomp and print while <STDIN>\"\`]}'"
anonymous
anonymous / sm.pl
Created December 21, 2012 22:33
Smartmatch and arrayrefs
use strict;
use warnings;
print "ok 1\n" if 2 ~~ (1,2);
print "ok 2\n" if 2 ~~ [1,2];
my $foo = [];
print "ok 3\n" if $foo ~~ (1,$foo);
print "ok 4\n" if $foo ~~ [1,$foo];