You mean this?
my @sorted_names= @names[ my @idx= sort {$ages[$a]<=>$ages[$b]} 0..$#ages ]; my @sorted_ages= @ages[@idx];
This is much more efficient than sorting by age all over again.
Update: Fixed my typo.
- tye (but my friends call me "Tye")In reply to RE: RE: Simple sorting by another parallel array
by tye
in thread Simple sorting by another parallel array
by merlyn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |