Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
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?
[Eily]: choroba Wikipedia gives me Zavináč which doesn't seem to translate to something edible?
[Eily]: (yes I'm very good at using question marks, thank you)
[Discipulus]: O_O frexit for you! even me i tried. it was in the arabic quarter in Granada; they offered as 'tapas' in bars. I eataly somewhere they eat ;=P Sardinia a Pulia iirc
[choroba]: Zavináč
[Eily]: choroba oh, that makes sense :)

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2017-11-21 11:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (297 votes). Check out past polls.

    Notices?