in reply to sorting two arrays together
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;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: sorting two arrays together
by youlose (Scribe) on Dec 23, 2010 at 09:11 UTC |