in reply to Parsing timestamps
Untested, but should work fine.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! } }
|
|---|