in reply to Read in values and average -- Perl for MacOS X

An unreadable one-liner: (I'll probably get downvoted for this :( )

perl -ple 'BEGIN { $/ = qq(\t); $x=0; @l=(); $y=1;} $l[$x]+=$_, $y++ for (split /\n/); } continue { $l[$x] /= $y, $y = 1, $x++ if eof; } for (@l) { ' *.txt > file.list

*.txt is the pattern of the input files, file.list is the output file. (you might need to change the single quotes to double quotes)

People that try to figure this one out: take a look at `perldoc perlrun` and `perldoc -f eof`

Update, removed 'close ARGV,' since it had no effect. (in my first attempt I used $., which is why it was there)