while ( <> ) { @F = split ','; $t += $F[1]; eof and print $t; } # Usage: perl mytally.pl siteperf.txt