Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

How do I convert ( ' ) into something Prolog's name/2 can handle, e.g. ( \' )?

by Zombie eubios (Initiate)
on Oct 17, 2001 at 05:03 UTC ( #119303=perlquestion: print w/replies, xml ) Need Help??
Zombie eubios has asked for the wisdom of the Perl Monks concerning the following question:

In other words, how do I convert single quotes into escaped single quotes?
  • Comment on How do I convert ( ' ) into something Prolog's name/2 can handle, e.g. ( \' )?

Replies are listed 'Best First'.
Re: How do I convert ( ' ) into something Prolog's name/2 can handle, e.g. ( \' )?
by MrNobo1024 (Hermit) on Oct 17, 2001 at 07:56 UTC
    Just use a substitution regex:
    $str =~ s|'|\\'|g;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://119303]
help
Chatterbox?
[Corion]: Hurr - those people from that shady VPN / proxy backdoor site are persistent - today is the third time they've mailed me about backdooring my software with their "SDK".
[Corion]: I guess I should blacklist them on my mailserver directly.

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (9)
As of 2018-05-21 14:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?