Given your time format, you don't need to worry about actually handling it as a time. You can just handle it as a string and things will still just work.
while (<LOGFILE>) { next unless /\b(\d\d:\d\d:\d\d)\b/; if (($1 ge '08:45:00' && $1 le '12:00:00') or ($1 ge '14:00:00' && $1 le '17:00:00')) { # do stuff. # line is in $_, time is in $1 } }
"The first rule of Perl club is you do not talk about
Perl club."
-- Chip Salzenberg
In reply to Re: parsing time information from a TAB delimited array, kind of.
by davorg
in thread parsing time information from a TAB delimited array, kind of.
by dbuk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |