http://qs1969.pair.com?node_id=24858


in reply to Sorting on Section Numbers

Of course, there is a module on CPAN which does what you want! It's called Sort::Versions, available from http://search.cpan.org/search?dist=SortVersions and it basically does what you want:
#!/usr/local/bin/perl

use strict;
use Sort::Versions;

my @sections = qw(2.1.7 2.2 3.4a 2.13 1 2);
@sections = sort versions @sections;
print "@sections\n"; # prints "1 2 2.1.7 2.2 2.13 3.4a"
Hope this helps! Leon