in reply to sorting multiple arrays on the criteria of one array

Sort the reference array, but record the ordered indexes, then use those to reorder the other two arrays:

#! perl -slw use strict; my @a1 = reverse 1 .. 10; my @a2 = 'a' .. 'j'; my @a3 = 'A' .. 'J'; ## sort the array but record the ordered indexes. my @order = sort{ $a1[ $a ] <=> $a1[ $b ] } @0 .. $#a1; @a1 = @a1[ @order ]; @a2 = @a2[ @order ]; @a3 = @a3[ @order ]; print "@$_" for \( @a1, @a2, @a3 ); __END__ P:\test>junk3 1 2 3 4 5 6 7 8 9 10 j i h g f e d c b a J I H G F E D C B A

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
The "good enough" maybe good enough for the now, and perfection maybe unobtainable, but that should not preclude us from striving for perfection, when time, circumstance or desire allow.