in reply to Re: Sorting path like strings
in thread Sorting path like strings

borisz,
I think the following recursive implementation does basically the same thing - don't ask me how I came up with it.
my @data = map {chomp; [ split '/' ] } <DATA>; @data = map { join '/', @$_ } sort my_sort @data; sub my_sort { my $i = shift || 0; if ( defined $a->[$i] && defined $b->[$i] ) { return $a->[$i] <=> $b->[$i] || my_sort(++$i); } return defined $a->[$i] ? 1 : -1; }

Cheers - L~R