Here's a basic Schwartzian Transform solution to an example problem that is very similar to yours.
my @array1 = qw/this that those these/; my @array2 = qw/2 3 1 4/; my @sorted = map { $_->[1] } sort { $a->[0] <=> $b->[0] } map { [$array2[$_] , $array1[$_]] } 0 .. $#array2; { local $" = "\t"; print "@array1\n"; print "@sorted\n"; }
Hope this helps...
Dave
In reply to Re: Sort array1 according to sorting of array2
by davido
in thread Sort array1 according to sorting of array2
by noname00
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |