There runs now a topic on moscow.pm list on how to calculate a sum of numbers in a list, basically
this:
but without using extra vars and modules (nurture your inner purist, yes :) Now I believe I found a line that wasn't discovered before:my $sum = 0; $sum += $_ for @list;
print sub { (map {splice @_, 0, 2, $_[0] + ($_[1] // 0)} @_)[-1] }-> ( +1,2,3,4,5);
Hopefully you'll find it amusing :)
Back to
Obfuscated Code