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
In reply to Re^2: Sorting path like strings
by Limbic~Region
in thread Sorting path like strings
by BUU
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |