Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: READDIR - Sort by Time?

by twerq (Deacon)
on Sep 24, 2002 at 14:00 UTC ( [id://200368]=note: print w/replies, xml ) Need Help??


in reply to READDIR - Sort by Time?

my @dirfiles = sort { -M $a <=> -M $b } grep !/^\.\.?$/, readdir ORDERS;

should work, I guess. Don't forget to prepend $a and $b with the directory path you opened (if you're not working in ./).

--twerq

Update: Aristotle's solution is better. :)

Log In?
Username:
Password:

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

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

    No recent polls found