On 3/16/10 Tue Mar 16, 2010 2:05 PM, "ben perl" <ben.perl3@gmail.com>
scribbled:
> Hi Jim,
>
> Thanks for the reply. This seem to work only if i am running perl on the
> machine itself.
>
> I am instead using expect to ssh into this machine and run stat command and
> use the output from that command to check the output of that stat command.
Then check out the various date/time modules included with Perl or available
on CPAN, including Time::localtime, Time::Local, Date::Calc, DateTime,
and Date::Manip.
Date::Manip in particular has the ParseDate function for return a numerical
time given a string.
You can also do your own parsing of the output of stat, extracting the date
and time fields and using the timelocal or timegm functions of the
Time::Local module to calculate Unix times.
|