... I would like to sort these filenames based on the number after the last underscore ...
This implies the OPer wants a numeric comparison of an extracted set of digits, so the <=> (also in Equality Operators; see perlop) numeric comparator would be appropriate here.
In reply to Re^2: Sorting filenames with custom function
by AnomalousMonk
in thread Sorting filenames with custom function
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |