Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: substitution of a string with Square brackets.

by GrandFather (Saint)
on Mar 20, 2006 at 10:41 UTC ( [id://537911]=note: print w/replies, xml ) Need Help??


in reply to substitution of a string with Square brackets.

Use \Q and \E to quote the string:

$line =~ s#$methodname\((\Q$2\E)\)#private $methodname($2)#g

DWIM is Perl's answer to Gödel

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (8)
As of 2024-03-28 11:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found