Seems to me you want to compare just the numbers, numerically ...
@a = sort { my ($c, $d); $c = $1 if $a =~ m/(\d+)/; $d = $1 if $b =~ m +/(\d+)/; $c<=>$d } @a
Or something like that anyway. Hopefully someone perl-golfs me. I'd like to see the most concise way to say the above. Could be shmem came up with something better below. It's not shorter, but probably better.
-Paul
In reply to Re: sorting numbered words
by jettero
in thread sorting numbered words
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |