Check out the Sort::Naturally module - it should do what you want. Getting the sort function to do this isn't hard, but it's not entirely straight-forward, either. At least not until you see the 'trick' (which is to separate out the letters from the numbers and find a way to sort on them separately - one way is to use an intermediate string where you insert leading zeros - ca1 becomes ca01, for example). And, of course, understand the trick. ;-) Sort::Naturally encapsulates this in a way that makes it easy even for more advanced monks to not get it wrong.
In reply to Re: sorting out directories
by Tanktalus
in thread sorting out directories
by kulls
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |