Sorry, my previous remark on .. and ... was silly. These operators won't help you here, since you don't know whether there actually is an entry in the log file with the very starting/ending times of the interval you are checking for.
In this case, I would proceed as follows:
Convert your string timestamp (2006-04-06 09:22:44) into a numeric value. You can do this forexample by extracting the respective fields by a regexp, and then use the functions in Time::Local to convert them into a time value. If you do the same with the starting/ending time, you can use numeric comparision to see whether the record falls within the range.
If you don't want to fiddle around with regular expressions (though in your case, they will be simple, because the timestamp always looks alike, doesn't it?), you could maybe use Date::Parse from CPAN. I have never worked with Date::Parse though, so I can't really say how useful it is for your application.
In reply to Re^3: Hi Perlmonks, I have need to write a script to do the following
by rovf
in thread Hi Perlmonks, I have need to write a script to do the following
by timvzid1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |