Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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 lurking in the Monastery: (6)
As of 2014-12-20 06:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (95 votes), past polls