Gossamer Forum
Home : General : Perl Programming :

Perl -M file test

Quote Reply
Perl -M file test
I'm not sure how to use the "-M" file test? Or maybe there is an easier way to read in a directory and find out which sub directory has been last modified?

Thanks
Quote Reply
Re: [neckbeard44] Perl -M file test In reply to
-M returns the age of the file in days.

my $age = -M $file;

This is probably a perl forum question...maybe Wil will move it.

Last edited by:

Paul: Jun 25, 2002, 1:18 PM
Quote Reply
Re: [Paul] Perl -M file test In reply to
Great............now how do you decipher this number that it returns? .119837962962963

I completely missed the 'Perl' forum..........now I see it. Not sure how to move this thread?
Quote Reply
Re: [neckbeard44] Perl -M file test In reply to
A moderator will move the thread at some point.

>>now how do you decipher this number that it returns? .119837962962963<<

How do you want to decipher it?...it is the number of days since modification so .11 days.

For arguments sake lets call it 0.1 ....so thats a 10th of a day....so 24 / 10 = 2.4 hours.

I think my math is right :)