in reply to Re^2: sorting files by date and names
in thread sorting files by date and names
Well, [stat]->[10] gives the "creation" time, and the modification time is in 9; so you could do this:
my @sorted_files = map { $_->[0] } sort { $a->[1] <=> $b->[1] or $a->[2] <=> $b->[2] } map { [ $_, [stat]->[10], [stat]->[9] ] } @files;
But for some reason, I'm tempted to do this:
my @sorted_files = map { $_->[0] } sort { $a->[11] <=> $b->[11] or $a->[10] <=> $b->[10] } map { [ $_, stat ] } @files;
|
|---|