Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
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?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (7)
As of 2016-06-29 22:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (387 votes). Check out past polls.