my @sorted = sort {$order{$a} <=> $order{$b}} @to_be_ordered;
This is not well-behaved for elements of @to_be_ordered that aren't present in %order.
--
The hell with paco, vote for Erudil!
:wq
In reply to Re: Sorting an array based on hash values
by FoxtrotUniform
in thread Sorting an array based on hash values
by kevsurf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |