Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: help required for regexp

by Corion (Pope)
on Dec 07, 2011 at 09:36 UTC ( #942192=note: print w/ replies, xml ) Need Help??


in reply to help required for regexp

Maybe you want the /e switch (see perlre)?

%Hidlabels = {3333=>1, 4444=>2, 2222=>3}; $formula =~ s/f(\d+)/$Hidlabels{$1}/ge;


Comment on Re: help required for regexp
Select or Download Code
Re^2: help required for regexp
by Eliya (Vicar) on Dec 07, 2011 at 09:55 UTC

    Why /e ?  The substitution side behaves like a double quoted string, so $Hidlabels{$1} already interpolates.

      Uh - yes - I'm not thinking clearly.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (9)
As of 2015-07-04 08:57 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 (58 votes), past polls