Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
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
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 musing on the Monastery: (6)
As of 2015-07-05 20:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (68 votes), past polls