That would only work for if all of JS, HTML and Perl used "\" to escape. HTML doesn't.
Assuming you had the right number of slashes — you don't — you're code results in the following HTML:
<a href='' onclick='alert(\' <- Nice JS! test\')' <- eh? ></a>
In reply to Re^3: Perl, JavaScript and quoting/escaping
by ikegami
in thread Perl, JavaScript and quoting/escaping
by isync
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |