3 ms·
`END{ }` could be replace by eskimo operator `}{`: perl -F, -lane '$t += $F[1]; }{ print $t' http://www.perlfoundation.org/perl5/index.cgi?eskimo_operator h
by d0mine 16y ago
`END{ }` could be replace by eskimo operator `}{`:
perl -F, -lane '$t += $F[1]; }{ print $t'
http://www.perlfoundation.org/perl5/index.cgi?eskimo_operator http://www.perlfoundation.org/perl5/index.cgi?eskimo_operato...
`..` is called flip-flop in the context describe in the post.
Goatse operator `=()=`:
my $count_vowels =()= /[aeiou]/g;
Here's another usage for `\K`:
echo '/a/b/c/def/gh' | perl -lnE'$d{$`}++while/\w\K\b/g }{$,=" ";say keys%d'
Output:
/a/b/c/def/gh /a/b/c /a/b/c/def /a/b /a
http://stackoverflow.com/questions/2892126/file-fix-it-codegolf-gcj-2010-1b-a/2894170#2894170 http://stackoverflow.com/questions/2892126/file-fix-it-codeg...
Other features: http://stackoverflow.com/questions/161872/hidden-features-of-perl/ http://stackoverflow.com/questions/161872/hidden-features-of...