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

Re: 3 Examples of Multiple-Word Search n Replace

by enoch (Chaplain)
on Jun 27, 2003 at 21:20 UTC ( #269746=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my %ch = ('green' => 'lousy',
             'blue'  => 'cool',
    ...
    my $regex = qr/$keyList/;
    $str =~ s/$regex/$ch{$1}/g;
    print $str ;
    
  2. or download this
    my %ch = ('green' => 'lousy',
             'blue'  => 'cool',
    ...
    
    I have a green hat, blue shirt, plus a pink jacket
    I have a lousy fedora, cool shirt, plus a mini jacket
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2023-12-10 04:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (38 votes). Check out past polls.

    Notices?