in reply to Re: Sorting based on a specific order
in thread Sorting based on a specific order

my @order = ...; my %order = map { $order[$_] => $_ } 0..$#order; my @sorted = sort { $order{$a} <=> $order{$b} } @unsorted;