# usual strict and warnings and such use Date::Parse; # to parse the entry date use Text::ParseWords; # to handled quoted entries # $logfile defined in skipped code open DF, $logfile or die $!; while () { chomp; # the following conversion is so the date can be # captured intact s/(\[|\])/"/g; my @part = Text::ParseWords::quotewords( '\s+', 0, $_ ); $part[3] = str2time( $part[3] ); # deal with whatever part # of the log entry here you need } close DF;