Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: sorting based on a list

by merlyn (Sage)
on May 09, 2001 at 18:36 UTC ( [id://79101]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @indicies = sort { $list[$a] cmp $list[$b] } 0..$#list;
    my @rearranged = @list2[@indicies];
    
  2. or download this
    my @indicies = sort { $list[$a] cmp $list[$b] } 0..$#list;
    my @rearranged;
    @rearranged[@indicies] = sort @list2;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2024-04-24 21:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found