Name : perl-JavaScript
| |
Version : 1.160.0
| Vendor : Mandriva
|
Release : 2mdv2011.0
| Date : 2010-07-20 20:40:26
|
Group : Development/Perl
| Source RPM : perl-JavaScript-1.160.0-2mdv2011.0.src.rpm
|
Size : 0.16 MB
| |
Packager : Jérôme Quelin < jquelin_mandriva_org>
| |
Summary : Execute JavaScript from within Perl
|
Description :
JavaScript.pm is an interface to the SpiderMonkey JS engine. It lets you execute JS code, call JS functions, bind Perl classes to JS, import Perl functions to JS, precompile and exeute scripts among many other things. It does conversion between Perl and JS datatypes.
use JavaScript;
my $rt = JavaScript::Runtime->new(); my $cx = $rt->create_context();
$cx->bind_function(write => sub { print AATT_; });
$cx->eval(q/ for (i = 99; i > 0; i--) { write(i + \" bottle(s) of beer on the wall, \" + i + \" bottle(s) of beer\ \"); write(\"Take 1 down, pass it around, \"); if (i > 1) { write((i - 1) + \" bottle(s) of beer on the wall.\"); } else { write(\"No more bottles of beer on the wall!\"); } } /);
|
RPM found in directory: /vol/rzm6/linux-mandriva/official/2011/i586/media/contrib/release |