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?? |
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. :)
In Section
Seekers of Perl Wisdom
|
|