in reply to Re: sort by date
in thread sort by date

I would rather do an orcish manueuver instead. ;-)

use File::stat; ... my %m; @allPictures = sort { ($m{$a} ||= stat($a)->mtime) <=> ($m{$b} ||= stat($b)->mtime) } @allPictures;
or simpler version -
my %m; @allPictures = sort { ($m{$a} ||= -M $a) <=> ($m{$b} ||= -M $b) } @allPictures;