Re: how to add a list of numbers
- From: aaron@xxxxxxxxxx (Aaron Priven)
- Date: Fri, 14 Jul 2006 23:22:17 -0700
Well, you can add a list of numbers with the module List::Util . It has a routine called "sum".
my @list = (8,10,2,5);
use List::Util qw(sum);
my $sum = sum (@list);
# $sum is now 25
It can add any numbers, random or not.
On Jul 14, 2006, at 11:00 PM, I BioKid wrote:
is there any shortest way to add a list of random numbers ?
for example :
11
1
250
39
100
....
,....
thanks
--
ibiokid
--
Aaron Priven, aaron@xxxxxxxxxx, http://www.priven.com/aaron
.
- References:
- how to add a list of numbers
- From: I BioKid
- how to add a list of numbers
- Prev by Date: how to add a list of numbers
- Next by Date: Re: HANDY PERL ONE-LINERS
- Previous by thread: how to add a list of numbers
- Next by thread: RE: how to add a list of numbers
- Index(es):
Relevant Pages
|
|