http://www.perlmonks.org?node_id=442252


in reply to Alpha number sort

Is this the order you require?

P:\test>442237 a1.5 a1.5b a1.6 a1.6b a1.55 a1.55b linux-2.4.3.tar linux-2.4.28.tar linux-2.4.29.tar linux-2.4.29a.tar linux-2.10.6.tar linux-2.10.50.tar

If so:

#! perl -slw use strict; print map{ $_->[0] } sort { $a->[1] cmp $b->[1] } map { ( my $vstring = $_ ) =~ s[(\d+)][chr $1]ge; [ $_, $vstring ] } <DATA>; __DATA__ a1.5 a1.55 a1.55b a1.5b a1.6 a1.6b linux-2.10.50.tar linux-2.10.6.tar linux-2.4.28.tar linux-2.4.29.tar linux-2.4.29a.tar linux-2.4.3.tar

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco.
Rule 1 has a caveat! -- Who broke the cabal?