in reply to Finding oldest file in directory
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.
update: Darn it. I misread [10] as wanting the size, even though there were other clues in the message about wanting the oldest.
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
Be sure to read my standard disclaimer if this is a reply.
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.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Finding oldest file in directory
by pg (Canon) on Oct 18, 2004 at 18:38 UTC | |
by halley (Prior) on Oct 18, 2004 at 18:41 UTC | |
by Fletch (Bishop) on Oct 18, 2004 at 18:58 UTC | |
Re^2: Finding oldest file in directory
by bluto (Curate) on Oct 18, 2004 at 19:15 UTC |
In Section
Seekers of Perl Wisdom