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.
In reply to Re^3: Getting the order of an array
by BrowserUk
in thread Getting the order of an array
by srdst13
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |