http://www.perlmonks.org?node_id=447281


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.