None of this addresses what OP is trying to achieve.
In reply to Re^2: Running JavaScript from within Perl by marto in thread Running JavaScript from within Perl by anautismobserver