$ ls -art test .. foo bar 42 23 999 abcd . $ perl -wE' my $dir = "test"; opendir my $dh, "test" or die $!; my @files = map { $_->[1] } sort { $b->[0] <=> $a->[0] } map { [-M "$dir/$_", $_] } readdir $dh; say "@files";' .. foo bar 42 23 999 . abcd