|Syntactic Confectionery Delight|
Using regex to add a single backslash to escape quotes, instead of 2 backslashes or 0by lancer (Beadle)
|on Jul 26, 2012 at 16:48 UTC||Need Help??|
lancer has asked for the
wisdom of the Perl Monks concerning the following question:
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?