in reply to Efficient way to sum columns in a file
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