in reply to How can I add all the numbers in an array with out doing a foreach loop?
@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
|
|---|