in reply to Parsing timestamps

A regex to match a time within the past 12 hours is doable, but it's probably not nearly as efficient as doing two passes, one to collect the time (if it's a PASS entry) and one to compare that time. But because I can't back away from a challenge:
use Time::Local; while (<$file>) { if (m{ ^ (\d\d\d\d) - (\d\d) - (\d\d) # capture y/m/d to $1,$2,$3 / (\d\d) : (\d\d) : (\d\d) # capture h/m/s to $4,$5,$6 (?(?{ timelocal($6,$5,$4,$3,$2-1,$1-1900) < (time - 12*60*60) })(?!)) # fail if timestamp is older than 12 hours .* \*PASS\* }x) { # it's an ok line! } }
Untested, but should work fine.

Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart