2009/9/29 Andreas Moroder <[email protected]>: > Hello, > > according to the man glob can only sort by name. Is there a way to get a > list of files sorted by date ? >
sure.
first I will use unix's ls command like ls -ltr.
in perl one of the ways:
my @sorted = map { $_->[0] }
sort { $a->[1] <=> $b->[1] }
map { [$_,(stat $_)[9]] } glob "*";
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/
