in reply to Basic arithmetic functions

You don't really say it, but it sounds like you may want to do the avg based on ID, so what I would do would be:
my %procid; my %procidcount; open (FILE, "file"); while (<FILE>) { my ($id, $keystroke, $seconds) = split / /; $procid{"$id"} += $seconds; ($procidcount{"$id"})++ } foreach my $ids (sort keys %procid) { printf "Average for $ids is %f...\n", $procid{"$ids"} / $proci +dcount{"$ids"}; }
where data in file looks like this:
1234-5678 12 .345678 1234-5678 90 .123456 1234-5674 12 .345678 1234-5674 90 .123456 1234-5674 12 .345678
and output looks like:
Average for 1234-5674 is 0.271604... Average for 1234-5678 is 0.234567...

-Waswas