my @index = 0..$#a; @index = sort { $a[$a] <=> $a[$b] } @index; my @sorted_a = @a[@index]; my @sorted_b = @b[@index]; use List::MoreUtils qw/zip/; my @combined_sorted = zip @sorted_a, @sorted_b;
In reply to Re: sorting two arrays together
by moritz
in thread sorting two arrays together
by siskos1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |