my @sorted_files_Test_flat_file_write_over_name_only = map { $_->[0] } sort { $a->[1] <=> $b->[1] or $a->[0] cmp $b->[0] } map { [ $_, (stat)[9] ] } @files_Test_flat_file_write_over_name_only; #### my @sorted_files_Test_flat_file_write_over_name_only = map { substr($_, 11) } sort map { sprintf('%011d%s', (stat)[9], $_) } @files_Test_flat_file_write_over_name_only;