Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Pattern Matching, left-to-right

by antirice (Priest)
on Aug 20, 2004 at 16:11 UTC ( [id://384680]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Pattern Matching, left-to-right

Perhaps something like...

my %map = ( F => "|", S => "^", T => "&", R => "~", E => "\\" ); $msgu =~ s/\\([FSTRE])\\/$map{$1}/g;

antirice    
The first rule of Perl club is - use Perl
The
ith rule of Perl club is - follow rule i - 1 for i > 1

Replies are listed 'Best First'.
•Re^2: Pattern Matching, left-to-right
by merlyn (Sage) on Aug 20, 2004 at 16:28 UTC

      I get AB&F^CD when I run it, which the OP says is what should happen. By his description of the task the code is also exactly what he's after. Which case do you have in mind that it fails for?

      Makeshifts last the longest.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://384680]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.