|
|
| go ahead... be a heretic | |
| PerlMonks |
Re: Efficient way to sum columns in a fileby eibwen (Friar) |
| on Apr 13, 2005 at 06:51 UTC ( #447281=note: print w/ replies, xml ) | Need Help?? |
|
With regard to your creation of an array and subsequent iteration, it is possible to index the array returned by split and therefore avoid the subsequent iteration: $sum += (split(/,/))[5]; While indexing in this fashion is useful, I think the @F method would be faster in this case.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||