|Keep It Simple, Stupid|
Escaping the escaping escape characterby CiceroLove (Monk)
|on Jun 24, 2001 at 22:44 UTC||Need Help??|
CiceroLove has asked for the wisdom of the Perl Monks concerning the following question:
I have started a website that allows AppleScripters to upload script libraries and the script source is displayed on the website for others to see.
Unfortunately the escape character is the same as in Perl. So whenever someone uses the \ then it gets stripped out when committed to the mySQL database. I have tried several solutions.
$scriptSource =~ s/\\/\\\/g;
Which of course did not work. Then I tried:
$scriptSource =~ s/\\/&\#92/g;
Which of course also does not work. I have tried using \ any number of times. None of it works. I see that Perl Monks allows for escaped characters to display properly. How do I?
You can see what I mean by going to
http://applemods.citizenstrange.com/getMod.cgi?script_ID=16. The testMod's one line should read:
set theTestVar to "\""
Thanks for your help.
Fates! We will know your pleasures: That we shall die, we know; 'Tis but the time, and drawing days out, that men stand upon. - Act III,I, Julius Caesar