in reply to Re^4: Perl, JavaScript and quoting/escaping
in thread Perl, JavaScript and quoting/escaping

I'm surprised that (qq{\'\'} eq q{''}; wouldn't this be eq q{''}?

Still makes no sense to me.

" VS &quote;

So you're asking how to embed double quotes in a JS double-quoted string literal? This isn't really an appropriate place to ask that. One escapes them with a backslash:

alert("foo \"bar\" baz"); // foo "bar" baz

Replies are listed 'Best First'.
Re^6: Perl, JavaScript and quoting/escaping
by Anonymous Monk on May 06, 2011 at 06:03 UTC
    For example:
    open(...) or print 'alert("foo '.$!.' baz");';
    If/when $! contains one of '", ect. As the escape-e could be anything and in my case content provided from a insecure variable I need something that can withstand any amount of trickery done by malicious ppl.