in reply to Array sorting
(Assuming I've understood your rather muddled description?) Sort and array of indices to the first array in the appropriate order, and then use that to order the other two arrays:
print @a1, @a2, @a3;; A B A C D C D B 10 13 11 9 7 6 4 2 as ad ae at ag ak ao we @order = sort{ $a1[ $a ] cmp $a1[ $b ] } 0 .. $#a1;; print @a1[ @order ];; A A B B C C D D print @a2[ @order ];; 10 11 13 2 9 6 7 4 print @a3[ @order ];; as ae ad we at ak ag ao
|
|---|