in reply to In an array get the high value numerals to the lowest and also get its original index values
Try:
@array = (5,2,6,8,10,1,4,7,4,2,21,18,25,10);; @orderedIndexes = sort{ $array[ $b ] <=> $array[ $a ] } 0 .. $#array;; print @orderedIndexes;; 12 10 11 4 13 3 7 2 0 6 8 1 9 5
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: In an array get the high value numerals to the lowest and also get its original index values
by Anonymous Monk on Apr 20, 2016 at 07:37 UTC |