use Date::Manip; $limit = ParseDate("12 hours ago") or die "internal error"; while(<>) { /^(\S+).*\*PASS\*$/ and Date_Cmp($limit, ParseDate($1)) < 0 or next; print "found: $_\n"; }