in reply to Parsing a log file

Here's one that should do the trick without splitting thousands of lines. I'm not sure if it's really faster, but in the spirit of TIMTOWTDI:

open LOG, "test_log"; my %results; while (<LOG>) { /\.(\w+) (\d\d\d)$/ and $results{$1}{$2}++; } close LOG; foreach my $type (sort keys %results) { foreach my $code (sort keys %{$results{$type}}) { print "$type $code ".$results{$type}{$code}."\n"; } }

The chicken tracks at the beginning are a regular expression that looks for the letters after the last . and the three-digit code at the end. It assumes that the comments at the beginning of the file won't have a three-digit code at the end.