in reply to How can I add all the numbers in an array with out doing a foreach loop?
my $sum = 0; $sum = [map {$sum +=$_} @arrayToSum]->[$#arrayToSum];
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Answer: How can I add all the numbers in an array with out doing a foreach loop?
by choroba (Cardinal) on Jul 09, 2013 at 09:27 UTC | |
|
Re: Answer: How can I add all the numbers in an array with out doing a foreach loop?
by Tux (Canon) on Jul 12, 2013 at 08:40 UTC |