Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Checking if file has been modified in last 7 days using stat

by friedo (Prior)
on Mar 17, 2005 at 22:54 UTC ( [id://440576]=note: print w/replies, xml ) Need Help??


in reply to Checking if file has been modified in last 7 days using stat [9]

First, since you're only getting one element from stat, you might as well stick it in a scalar instead of an array. To see if a file was modified more than seven days ago, just get the current time and compare.

my $mtime = (stat $tapes)[9]; my $now = time; if( $mtime < ( $now - 604800) ) { print "$tapes is more than seven days old.\n"; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://440576]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (8)
As of 2024-03-28 10:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found