Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
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 meditating upon the Monastery: (4)
As of 2015-07-05 16:12 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 (67 votes), past polls