in reply to Sorting on Files
You can sort the filenames using sort(), and you can write your own comparison subroutine. See perlfunc:sort for details.
You can use substr() to get the number at the end. See perlfunc:substr for details.
You can use '<=>' to compare the numbers. See perlman:perlop for details.