Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: How to Order an Array's Elements to Match Another Array's Element Order

by tybalt89 (Parson)
on Sep 17, 2019 at 11:02 UTC ( #11106289=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    
    ...
    my @results = sort { $order{$a} <=> $order{$b} } @subset;
    
    print "results: @results\n";
    
  2. or download this
    results: APPLE GRAPE PINEAPPLE
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2019-11-13 00:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (67 votes). Check out past polls.

    Notices?