in reply to Re: Sort files
in thread Sort files

or the fastest:
use Sort::Key::Multi 'is_keysort'; # is_ => integer, string my @sorted = is_keysort { scalar((stat)[9]), $_ } @filenames;
I am using (stat)[8] instead of (stat)[9] because that's what the OP probably wants.

The scalar around (stat)[9] is required because stat could fail returning an empty list, and in list context, (()[9], $_) is equivalent to ($_). It is also required on ikegami GRT version.

update: oops, stat[9] was ok, it seems I didn't count for the mtime position on stat return values properly, thanks ikegami for pointing it out.