in reply to Sorting path like strings

The standard solution to the lexical vs. numerical sorting problem is using leading 0 s. Comparing '04' and '10' works in both cases. It is also reversible:
foreach (@in) {s|(\d+)|sprintf '%10.10d', $1|eg}; @in = sort @in; foreach (@in) {s|(\d+)|sprintf '%d', $1|eg};
This assumes that your numbers have up to 10 digits.