Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: Regular expression "replace string interpolation" problem

by ikegami (Pope)
on May 16, 2008 at 22:39 UTC ( #687041=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Regular expression "replace string interpolation" problem
in thread Regular expression "replace string interpolation" problem

Or how to embed " in the output - but that's not a biggie right now.

You want to produce the code
"$1 \"Perl\""
so
my $replace = '"$1 \\"Perl\\""'; # Produces: "$1 \"Perl\"" s/$match/eval $replace/e

Technically, the slashes don't need to be doubled since single quotes are forgiving when it's unambiguous.


Comment on Re^3: Regular expression "replace string interpolation" problem
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (8)
As of 2014-09-01 19:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (17 votes), past polls