{ local $[=1; @order = sort{ $vector[ $a ] <=> $vector[ $b ] } 1 .. $#vector; print @order; } 4 1 2 3 6 5