in reply to Sorting an array based on hash values
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: (FoxUni) Re: Sorting an array based on hash values
by thelenm (Vicar) on Jun 20, 2002 at 17:35 UTC |