Hi there:

I am trying to figure out a way to test a file with perl to find out when
it was lat modified and if that was within the last minute, do something,
otherwise exit.

I've gotten as far as this:

$file='filename.txt';
$lastModified = printf "%f", -M $file;

which gives me a number such as 0.122986 if the file was modified around a
day ago and 0.000023 if it was modified just a few seconds ago. Is this
modified number in seconds? How is it calculated? I tried an if/else
statement where if $lastModified was less than 0.000060 an action would
happen but I could not get it to work.

Any advice trying to understand how to accomplish this much appreciated.

Gary


-- 
To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
as the Subject.

Reply via email to