in reply to Sorting Outline Numbers

Presuming you don't have more than 255 (or 16k for you Unicodians) levels in any one outline you could always convert into a character string and just sort on that (sort of like a radix sort).

use List::Util qw( max ); my @raw = qw( 1.3 2.3 2.1 2.0 2.0.3 1.2 2.0.2 1.0 ); my $longest = max map { my @c = split(/\./, $_); scalar @c } @raw; my @sorted = map { $_->[1] } sort { $a->[0] cmp $b->[0] } map { my @c = split( /\./, +$_ ); push @c, ("0") x $longest - @c; [ pack( "c*", @c ), $_ ] } @raw; print join( "\n", @sorted ), "\n";

Update; Dang, japhy beat me. And the filling out to the same length's unnecessary; I don't know why I thought I needed to do that. Meh, need more caffeine.

--
We're looking for people in ATL