$sum += $_ for @array
And notice there's no foreach loop, which the Camel clearly states is a synonym for for anyway (see "perldoc perlsyn", 'Foreach Loops'), so maybe I'm not clear on what you're asking.
--marmot
In reply to Re: Answer: How can I add all the numbers in an array with out doing a foreach loop?
by furry_marmot
in thread How can I add all the numbers in an array with out doing a foreach loop?
by draco_iii
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |