Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Ordering hash replacements to avoid clobbering things

by xmath (Hermit)
on Feb 26, 2003 at 14:19 UTC ( #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
Node Status?
node history
Node Type: note [id://238775]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2015-07-05 18:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (67 votes), past polls