⭐ in reply to How can I add all the numbers in an array with out doing a foreach loop?
List::Util provides a sum() function:
use List::Util qw(sum); $sum = sum(1..10);
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Answer: How can I add all the numbers in an array with out doing a foreach loop?
by borisz (Canon) on Aug 16, 2006 at 09:48 UTC | |
Re: Answer: How can I add all the numbers in an array with out doing a foreach loop?
by b10m (Vicar) on Aug 15, 2006 at 10:49 UTC | |
by gellyfish (Monsignor) on Aug 15, 2006 at 10:58 UTC | |
| |
Re: Answer: How can I add all the numbers in an array with out doing a foreach loop?
by furry_marmot (Pilgrim) on Aug 16, 2006 at 13:29 UTC |
In Section
Seekers of Perl Wisdom