Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: s/// with 2 arrays

by Paladin (Vicar)
on Jun 07, 2004 at 16:08 UTC ( [id://362030]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my %subst;
    @subst{@first_half} = @second_half;
    s/\Q$_\E/$subst{$_}/ for keys %subst;
    
  2. or download this
    for (my $i = 0; $i < @first_half; $i++) {
        s/\Q$first_half[$i]\E/$second_half[$i]/;
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (5)
As of 2024-04-23 07:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found