Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: Sorting based on a specific order

by ikegami (Patriarch)
on Jan 02, 2011 at 07:37 UTC ( [id://880057]=note: print w/replies, xml ) Need Help??


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;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://880057]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (1)
As of 2024-04-15 16:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found