in reply to Re^2: Getting the order of an array
in thread Getting the order of an array
In addition to 1-based, his numbering implied right to left ordering. The 1-based ordering could be accomodated:
{ local $[=1; @order = sort{ $vector[ $a ] <=> $vector[ $b ] } 1 .. $#vector; print @order; } 4 1 2 3 6 5
though I wouldn't advise it. But accomating the reversal of the natural ordering without requiring sticking in unnecessary reverse calls all over the place was more of a problem.
|
|---|