That produces a different output than your original post, but if that's what you want, it can be simplified to:
my @sorted_indexes = sort { $array[$a] cmp $array[$b] } 0..$#array;
Note that cmp (not <=>) should be used here since you are comparing strings (not numbers).
In reply to Re^2: Remembering original order of an array
by ikegami
in thread Remembering original order of an array
by seaver
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |