use Sort::Key::Multi 'is_keysort'; # is_ => integer, string my @sorted = is_keysort { scalar((stat)[9]), $_ } @filenames;