Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: Sort list by position of items in another list

by rsFalse (Chaplain)
on Feb 20, 2022 at 20:13 UTC ( [id://11141522]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $pchr = "KQRBNP";
    my $w1 = "QRKPNBNBQRK";
    ...
    }
    
    print "$w1 -> $w2\n"
    
  2. or download this
    my $pchr = "KQRBNP";
    my $w1 = "QRKPNBNBQRK";
    ...
    $w1 =~ m/^(?:$re)(?<=(.))(?{ $w2 .= $1 })(*FAIL)/;
    
    print "$w1 -> $w2\n"
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-03-29 01:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found