如何在perl 代码里运行javascript 代码?

如何在perl 代码里运行javascript 代码?

如题, 希望达到如下效果,以下代码错在哪里,我来是运行不通过。
# JavaScript
    use Inline::WSC JavaScript => <<'MyJavaScript';
    function greet( name ) {
        return "Hello, " + name + "!";
    }
    var aa = [1, 2, 3, 4];
    function get_arr () {
        return new Date().toString();
    }
    MyJavaScript

print greet( 'John' ). get_arr() . "\n";

出错信息:

Win32::OLE(0.1707) error 0x80010105: "" at js.pl line 3
Couldn't create OLE 'InlineWin32COM.WSC_162c4bbd1b526c34b17e10898760ff98.wsc':
0  at d:/perl/site/lib/Inline/WSC.pm line 123.
BEGIN failed--compilation aborted at js.pl line 11.

出错信息呢?
还有应该是use Inline WSC JavaScript => <<'MyJavaScript';
按你那么写的话,出错信息:

syntax error at js.pl line 3, near "WSC JavaScript"
Execution of js.pl aborted due to compilation errors.
Do not use the words "sub" or "function" in the comments within your COM code.
The regular expression used to parse out the function names is too simple and
will result in errors that look like this:

  Couldn't create OLE 'InlineWin32COM.WSC_...wsc':
  317  at Inline/Win32COM.pm line xx.

以后要仔细看文档阿
何不用SpiderMonkey引擎呢?

http://search.cpan.org/~tbusch/JavaScript-SpiderMonkey-0.19/