in reply to Improving sorts using ST
For the non-numeric sort, replace <=> with cmp.@sorted_array = map {$_ -> [0]} sort {$a -> [1] <=> $b -> [1]} map {[$_ => (split /$delim/ => $_) [$key]]} @$array_2_ +sort_ref;
You are mistaken however that ST allows more complex sorting. There's nothing ST can sort that you can't sort with a non-ST method. ST can be more efficient though. However, a GRT often beats an ST when it comes to efficiency.
Abigail
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Improving sorts using ST
by drewbie (Chaplain) on May 20, 2004 at 17:45 UTC | |
by sweetblood (Prior) on May 20, 2004 at 19:33 UTC | |
|
Re: Re: Improving sorts using ST
by sweetblood (Prior) on May 20, 2004 at 14:57 UTC |