my %index; @index{@array} = 0..$#array; my @result = sort { $index{$a} <=> $index{$b} } @subset;
Dave.
In reply to Re: How to Order an Array's Elements to Match Another Array's Element Order
by dave_the_m
in thread How to Order an Array's Elements to Match Another Array's Element Order
by ozboomer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |