Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Using regex to add a single backslash to escape quotes, instead of 2 backslashes or 0by lancer (Scribe) |
on Jul 26, 2012 at 16:48 UTC ( [id://983874]=perlquestion: print w/replies, xml ) | Need Help?? |
lancer has asked for the wisdom of the Perl Monks concerning the following question:
Dear All, I have a function like Outputs this: O'REILLY When I print the result of that in a double quoted string, like so: my $escaped_text = sql_escape ($raw_text); print "$escaped_text" , it prints single quotes without the backslash. But if I change the function to add another backslash, it starts printing 2 backslashes:
Outputs this: O\\'REILLY How can I change it to output only 1 backslash?
Back to
Seekers of Perl Wisdom
|
|