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

qq{\'\'} eq q{''}

" VS &quote;

Replies are listed 'Best First'.
Re^5: Perl, JavaScript and quoting/escaping
by ikegami (Patriarch) on May 06, 2011 at 05:09 UTC

    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
      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.