Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: grab oldest file

by Hue-Bond (Priest)
on Jul 06, 2006 at 22:55 UTC ( [id://559689]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my %stats;
    for (<*>) {
      my $mtime = (stat)[9];   ## for atime, use (stat)[8]
    ...
    }
    my $oldest = (sort { $a <=> $b } keys %stats)[0];
    print "oldest: ", (join ',', @{$stats{$oldest}}), "\n";
    
  2. or download this
    my ($timestamp, $files) = ~0;
    for (<*>) {
      my $mtime = (stat)[9];   ## for atime, use (stat)[8]
    ...
      }
    }
    print "oldest: ", (join ',', @{$files}), "\n";
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (1)
As of 2024-04-26 02:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found