http://www.perlmonks.org?node_id=17360


in reply to How can I add all the numbers in an array with out doing a foreach loop?

The loopish way would be like:

@e = (1,2,3,4); my $foo; $foo += $_ for @e;

or you can do something like (still a loop, but you need to loop in some way for this):

@e = (1,2,3,4); print eval join '+', @e;

Cheers,
KM