I am using Perl to write some simple MySQL queries. My problem is that I am taking in a string that may contain either single quotes or double quotes and I want to store this string in a TEXT field.
It's obvious that I need to escape the single and double quotes within this string but how would I do this as the following substitution regular expression doesn't seem to work (it is only trying to escape double quotes).....
$reviewText =~ s/"/\"/g;
This is my first real Perl program and regular expressions still confuse me so any help would be much appreciated!
It's obvious that I need to escape the single and double quotes within this string but how would I do this as the following substitution regular expression doesn't seem to work (it is only trying to escape double quotes).....
$reviewText =~ s/"/\"/g;
This is my first real Perl program and regular expressions still confuse me so any help would be much appreciated!