in reply to Javascript and Perl

This:

$JSCRIPT=<<END;

...probably ought to be this:

$JSCRIPT=<<'END';

That way Perl won't try to interpolate variables (such as $") that are in the JS code.

I also suggest you use strict and use warnings.