if (/^LOGGING: \S+?-(\S+) \S+: (\S+) [^:]*: (\S+)$/) { my ($month, $what, $user) = ($1, $2, $3) ; if ($what eq 'STARTING') { $flushes{$month}{$user}++ ; $flushes{$month}{TOTAL}++ ; } ; } else { # Any error reporting you like, eg: chomp ; print STDERR "Line $.: '$_' ??\n" ; } ; #### .... LOGGING: 31-Mar-2008 23:59:10: ENDING ON A HIGH: countryjoe LOGGING: 1-Apr-2008 00:01:22: STARTING FLUSH: gotcha ....