http://www.perlmonks.org?node_id=487319


in reply to Re: Sort - can't
in thread Sort - can't

Sort what by what?

Your code is too way off for me to decipher your intentions.

If you want to sort the filenames by the substring after the last _, then I'd do something like

my @sorted = map $_->[ 0 ], sort { $a->[ 1 ] cmp $b->[ 1 ] } map [ $_, ( split '_' )[ -1 ] ], @unsorted;
(untested).

the lowliest monk