in reply to perl onliner on multiple files
Seems to work fine (on a reasonable number of files) if you want the total sum. If you want the sum per file, a minimal change would be to print and reset $c after each file ends.
For example:perl -e ' while (<>) { if (/: /) { $c += (split /: /)[0]; } if(eof) { print "SUM.$ARGV =$c\n"; $c=0; } }' tmp_*
In Section
Seekers of Perl Wisdom