Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Regular expression "replace string interpolation" problem

by pc88mxer (Vicar)
on May 17, 2008 at 07:09 UTC ( #687066=note: print w/ replies, xml ) Need Help??


in reply to Regular expression "replace string interpolation" problem

What is likely confusing is that both of these statements yield the same result:

$text2 =~ s/$match/$replace/; $text2 =~ s/$match/$replace/e;
The evaluation done in the second substitution replaces the variable interpolation that is taking place in the first substitution.


Comment on Re: Regular expression "replace string interpolation" problem
Download Code
Replies are listed 'Best First'.
Re^2: Regular expression "replace string interpolation" problem
by Anonymous Monk on Mar 31, 2009 at 15:58 UTC
    I used this and it works my $replace = "$1 Perl";

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (11)
As of 2015-07-08 04:13 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 (94 votes), past polls