use warnings; use strict; my $tot = 0; while (<DATA>) { my ($num, $date) = split; $tot += $num; printf "%-5d %s\n", $tot, $date; } __DATA__ 1 2005-01-16 6 2005-01-28 1 2005-01-31 2 2005-02-01 2 2005-02-02 1 2005-02-05
In reply to Re: Add numbers row by row
by toolic
in thread Add numbers row by row
by epimenidecretese
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |