The stupid question is the question not asked | |
PerlMonks |
Re: How can you make this script general?by llancet (Friar) |
on Mar 10, 2014 at 09:34 UTC ( [id://1077663]=note: print w/replies, xml ) | Need Help?? |
You should notice that Perl arrays are autovivified, where if you use an index out of range, the array will be auto-expanded. So what you need is: use an array to record the sum of columns. each time you read a line, and add the columns to the sum array.
In Section
Seekers of Perl Wisdom
|
|