Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Posting file's modification date?

by Eradicatore (Monk)
on Jun 13, 2001 at 00:02 UTC ( #87920=note: print w/replies, xml ) Need Help??


in reply to Posting file's modification date?

You can use -M to find out the age of the file since the last modification. This is age in days like 6.5321421 etc.
$age = -M $file;

Justin Eltoft

"If at all god's gaze upon us falls, its with a mischievous grin, look at him" -- Dave Matthews

Replies are listed 'Best First'.
Re: Re: Posting file's modification date?
by blakem (Monsignor) on Jun 13, 2001 at 10:15 UTC
    There is a mod_perl gotcha here... The file test operators calculate their deltas based on the "scripts" starting time. Under normal situations this works fine, but with mod_perl it can cause problems, since the starting time may have been weeks ago. (leading to values such as "This file was modified -5.24 days ago") Resetting the $^T variable to the current time will fix this.
    $^T = time(); $age = -M $file;
    Of course, if it is straight CGI, you don't need to worry about it.

    -Blake

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://87920]
help
Chatterbox?
Lady_Aleena clean up after dinner finally.
[Discipulus]: uch! so we are twice lucky to have MCE..;=)
[marioroy]: Working a midnight graveyard shift, on the way home ran out of gas. just 2 minutes later somebody stops with a small tank of gas. It's wierd. There's always someone nearby for some reason.
[Lady_Aleena]: I was the one who stop[ed in the middle of a cold night to pick up a small family walking to a gas station. I got a few gallons of free gas for the round trip, and the grandmother said she'd pray for me.
[marioroy]: Folks do not know it, but MCE was ridiculously difficult. At Niagra Falls, heard a voice on enabling Grace while in the mist boat. That 10x performance is possible.
[marioroy]: Lady_Aleena Angels on earth are real people. That's awesome.
[Lady_Aleena]: marioroy, what does MCE stand for in this instance? There are 3 pages of abbreviations to go through.
[Lady_Aleena]: ^ or Discipulus...
[marioroy]: Many-core Engine
[choroba]: MCE

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (12)
As of 2017-05-29 08:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?