The documentation seems to indicate that the -M is the number of days
older than the script start time the file modification time is.  I think
what you want would be something like:

  If( (stat $path)[9] > time - 1200 ){
      Do something...
  }

Which will get the 10th (starts from 0) element of the array returned by
the stat function, which is the file modified time and make sure that it
is newer than 1200 seconds (20 minutes) ago.



-----Original Message-----
From: Omega -1911 [mailto:[EMAIL PROTECTED] 
Sent: Friday, July 07, 2006 5:08 PM
To: Beginners Perl
Subject: File last modified time

<snip>

2. Instead of opening all of them, I am trying to only open those files
where the file was actually MODIFIED not just accessed within the
last 20 minutes.

<snip>

if (-M "$path" >= (20 / 1440)) {
   next;
}


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to