in reply to Add numbers row by row
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Add numbers row by row
by epimenidecretese (Acolyte) on Oct 25, 2013 at 14:20 UTC | |
by toolic (Bishop) on Oct 25, 2013 at 14:26 UTC | |
by LanX (Saint) on Oct 25, 2013 at 14:25 UTC |