in reply to Sorting path like strings
sub do_the_sort { my @aa = split /\//, $a; my @bb = split /\//, $b; for ( 0 .. $#aa ) { return 1 unless defined $bb[$_]; my $zz = $aa[$_] <=> $bb[$_]; return $zz if $zz; } -1; } my @y = sort do_the_sort @x;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Sorting path like strings
by Limbic~Region (Chancellor) on Jan 05, 2006 at 16:49 UTC |