Here's a -10...
sub get_neg_10_outta_these { my $n = shift; my $sum; $sum += $n - $_ for (@_); return $sum; } my @nums = (2, 4, 5, 7); print get_neg_10_outta_these(@nums),"\n";
-sauoq "My two cents aren't worth a dime.";
In reply to Re^3: Finding Sum of Consecutive Numerical Difference in Set of Numbers
by sauoq
in thread Finding Sum of Consecutive Numerical Difference in Set of Numbers
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |