I'm now gonna stick this here so that I can refer it back and hopefully remember this for good.
Basically, the idea is to ....
Putting the above into a perl script works wonder:
always just replace each embedded single quote with the sequence: '\''
(that is: quote backslash quote quote) or '"'"' , which closes the string, appends an escaped single quote and reopens the string.
https://stackoverflow.com/a/1315213/335181Putting the above into a perl script works wonder:
#!/usr/bin/perl -pl
s/'/'\\''/g; ### or s/'/'"'"'/g;
$_ = qq['$_'];