Damn, so I don't know how to use this thing... (managed to post anon and mess up the present)
Here it is (hopefully the corect way...)
--------------------------------------------------------------
#!/usr/bin/perl
@list = ("1", "3.4b.4", "2", "15", "123", "2.2", "2.13", "2.1.7", "311
+2", "3.4a", "1.5.32.1", "3.4.1", "3.1.5", "3.4b.1");
foreach $section (@list) {
my @subSections = split (/\./, $section);
for (my $x=0; $x <= $#subSections; $x++) {
if ($maxdigit[$x] < length($subSections[$x])) { $maxd
+igit[$x] = length($subSections[$x]); }
}
}
my @paddedList = ();
foreach $section (@list) {
my @subSections = split (/\./, $section);
my $paddedSection = "";
for (my $x=0; $x <= $#subSections; $x++) {
my $padding = "";
for(my $y = 0; $y < $maxdigit[$x]-length($subSections[
+$x]); $y++) { $padding .= "0"; }
$paddedSection .= "$padding$subSections[$x].";
}
$paddedSection =~ s/\.$//;
push (@paddedList, $paddedSection);
}
@sortedList = sort @paddedList;
foreach $section (@sortedList) {
my @subSections = split (/\./, $section);
my $unPaddedSection = "";
for (my $x=0; $x <= $#subSections; $x++) {
$subSections[$x] =~ s/^0*//;
$unPaddedSection .= "$subSections[$x].";
}
$unPaddedSection =~ s/\.$//;
push (@unPaddedList, $unPaddedSection);
}
foreach $li (@unPaddedList) {
print "$li\n";
}
--------------------------------------------------------------