in reply to Efficiently parsing a large file

yeah, how about not looping through the file more than once for starters.
#!perl -wl use strict; #bit fields my %status = qw( begin 1 doing-work 2 complete 4 ); # figure out what a "perfect" score is my $ok = (2 ** (scalar keys %status)) - 1; # where we keep stuff my (%entries); #open F, "<logfile" or die $!; while (<DATA>) { if (/^(\d{4}HA-\d{5}) (\S+)$/) { $entries{$1} |= $status{$2}; } } #close F; #filter out entries that passed for (grep{ $entries{$_} == $ok }keys %entries) { delete $entries{$_}; } printf( "%d entries failed\n", scalar keys %entries ); for (sort keys %entries) { print "$_: $entries{$_}"; } __DATA__ 1234HA-00001 begin 1234HA-00002 begin 1234HA-00003 begin 1234HA-00001 doing-work 1234HA-00002 doing-work 1234HA-00001 complete

perl -e'$_="nwdd\x7F^n\x7Flm{{llql0}qs\x14";s/./chr(ord$&^30)/ge;print'