in reply to Sorting help

Use the sort function with a usersub call. The usersub can pull the numbers out of the name using a regex.

The code below is untested, as always. There are probably more efficent ways of doing this, but this seems like the most straightforward way to me.

sort { $a =~ /\A\w+(\d+)_(\d+).*\z/; my ($a1, $a2) = ($1, $2); $b =~ /\A\w+(\d+)_(\d+).*\z/; my ($b1, $b2) = ($1, $2); ($a1 <=> $b1) or ($a2 <=> $b2); }, @array;