Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Getting a list of files in a directory sorted by date

by explorer (Chaplain)
on Apr 07, 2006 at 16:33 UTC ( #541902=note: print w/ replies, xml ) Need Help??


in reply to Getting a list of files in a directory sorted by date

opendir(DIR,$logdir); foreach( readdir(DIR) ) { next unless /\w/; $date{ -M $_ } = $_; # Store modification's time } closedir DIR; foreach ( sort { $a <=> $b } keys %date ) { print $date{$_} # Show ordered files }


Comment on Re: Getting a list of files in a directory sorted by date
Download Code
Replies are listed 'Best First'.
Re^2: Getting a list of files in a directory sorted by date
by Ovid (Cardinal) on Apr 07, 2006 at 16:46 UTC

    What happens when you have two files with the same mtime?

    Cheers,
    Ovid

    New address of my CGI Course.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (16)
As of 2015-09-03 12:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred temperature scale is:










    Results (109 votes), past polls