Welcome to the Monastery | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Look at the three file test operators -M, -A and -C and decide which of them best mirrors your "time created". Let's assume it's -M. The naive way to sort a list of files then becomes:
But you specifically asked for an efficient method, so you'll probably want to replace that with an Orcish Maneuver or a Schwartzian Transform. See Uri Guttman and Larry Rosler's excellent paper for discussion of these methods and other Perl sorting mechanisms. Also, you have this code:
I think you're confusing open and opendir. for opendir you don't need the '<' on the directory name. In fact, I'm surprised to see that it works.
-- "The first rule of Perl club is you do not talk about Perl club." -- Chip Salzenberg In reply to Re: sorting files by date
by davorg
|
|