Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: substituting 1 escaped character for another

by choroba (Cardinal)
on Jul 26, 2018 at 17:49 UTC ( [id://1219332]=note: print w/replies, xml ) Need Help??


in reply to Re: substituting 1 escaped character for another
in thread substituting 1 escaped character for another

Also note that the backslash in the replacement part is useless and could be even misleading as someone might think that \< has a special meaning.
s/\(/</

If there are more parentheses to replace, use the /g modifier:

s/\(/</g

Also, in case of single character replacements, you can use transliteration:

tr/(/</

($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2024-04-24 04:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found