my @totals; foreach my $row ( 1 .. 10 ) { my @output; foreach my $column ( 1 .. 10 ) { push @output , $column; } $totals [$_] += $output [$_] for 0 .. $#output; print join ',' , @output; } # print column totals here print "@totals";
This will even work if the rows don't all have the same size.
Abigail
In reply to Re: Multi-Column Totals
by Abigail-II
in thread Multi-Column Totals
by Limbic~Region
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |