yschang has asked for the wisdom of the Perl Monks concerning the following question:

I have a text file which is a records read from some system status. Each line is a single record contains Time (in format of hh:mm:ss) and Date (in format of mm/dd/yyyy). each line is added every 10 min. My job is to compare those record, if there is a GAP between the time, then I should give a warning sign. However I can't find conversion function to convert text format into Time. How to compare the time. Thanks

Replies are listed 'Best First'.
Re: How to compare time
by lhoward (Vicar) on Mar 27, 2000 at 22:48 UTC
    Take a look at the Time::ParseDate module. Its one of my favorite modules (right behind DBI, LWP and Net) Les Howard les@lesandchris.com http://www.lesandchris.com Author of Net::Syslog and Number::Spell
Re: How to compare time
by btrott (Parson) on Mar 27, 2000 at 21:47 UTC
    use Time::Local; my $time_secs = timelocal($secs, $min, $hour, $day, $mon, $year);
    $time_secs is now epoch seconds, and comparing two times in epoch seconds is trivial.
    perldoc Time::Local
    for more information, documentation, etc.

    You may also want to check out Date::Manip.