Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
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 imbibing at the Monastery: (6)
As of 2014-12-28 22:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (183 votes), past polls