Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
How do I get the sum of all the data form $newno? If I write print $newno .... I get the list of number for example 23 34 45 33 .... How do I make the code to do this(23+ 34 +45 +33+ ....) and give me an answer. Thanksif ($row ne 0) { $number = 0; while (($number) = $sth->fetchrow_array()) { $number++; $numbergraf++; my $newno = substr($number, 0, 2); $output .=qq~ The sum of xxx is $newno ~;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: calculate all the data
by thedoe (Monk) on Feb 20, 2005 at 06:38 UTC | |
|
Re: calculate all the data
by Zaxo (Archbishop) on Feb 20, 2005 at 05:10 UTC | |
|
Re: calculate all the data
by sh1tn (Priest) on Feb 20, 2005 at 05:08 UTC |