Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Ordering hash replacements to avoid clobbering things

by xmath (Hermit)
on Feb 26, 2003 at 14:19 UTC ( [id://238775]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
    my $example = "FOO CO COM BAR MOC SEC";
    $example =~ s/($searchpat)/$replace{$1}/g;
    print "$example\n";
    
  2. or download this
    FOO MOC SEC BAR COM COM
    
  3. or download this
    my $example = "MOC.COMPUTER.COM.FOO / SEC.SECT / CO";
    $example =~ s/\b($searchpat)\b/$replace{$1}/g;
    print "$example\n";
    
  4. or download this
    COM.COMPUTER.SEC.FOO / COM.SECT / MOC
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://238775]
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-19 19:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found