in reply to How to Order an Array's Elements to Match Another Array's Element Order
Create a hash to map name to index and use that to sort.
my %index; @index{@array} = 0..$#array; my @result = sort { $index{$a} <=> $index{$b} } @subset;
Dave.
|
---|
In Section
Seekers of Perl Wisdom