Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://687041]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (9)
As of 2017-10-19 21:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (257 votes). Check out past polls.

    Notices?