I cannot find the resources for this. I want to escape double quotes with perl and i am new to this language.
Here's what I have:
$comment =~ s/\"/\\\"/g;
One way, to avoid counting backslashes
$comment =~ s/"/q(\")/eg;
/e modifier evaluates the replacement part, where you force a literal string by
Note though that in this simple case
s/"/\"/ works fine. There is probably more going on in your code, or your quotes come already escaped in which case extra
\ affect what you see later.