|
|
| Keep It Simple, Stupid | |
| PerlMonks |
•Re: Finding oldest file in directoryby merlyn (Sage) |
| on Oct 18, 2004 at 18:25 UTC ( #400266=note: print w/ replies, xml ) | Need Help?? |
|
Probably only the teeniest bit faster to run, but a lot easier to type, I would have picked -s $a over (stat $a)[10] and so on. Also, above some number of files (depending on your OS efficiency), it'd be faster to cache your stats for the sort. -- Randal L. Schwartz, Perl hacker
update: Darn it. I misread [10] as wanting the size, even though there were other clues in the message about wanting the oldest. OK, yes, replace -s there with -M.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||