Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Sorting based on a specific order

by Not_a_Number (Parson)
on Jan 02, 2011 at 17:40 UTC ( #880086=note: print w/ replies, xml ) Need Help??


in reply to Sorting based on a specific order

Or even (no sorting, no array index arithmetic):

my %wanted = map { $_ => 1 } @unsorted; my @sorted = grep { $wanted{$_} } @preferred;
Update: corrected typo 'arthimetic'.


Comment on Re: Sorting based on a specific order
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (15)
As of 2014-10-23 14:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (125 votes), past polls