in reply to sorting numbered words
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
|
|---|