Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > by-pkgid > ad1bd1fd40765183cb88fac54f659f0a

perl-JavaScript-1.120.0-2mdv2010.0.src.rpm

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 @_; });

$cx->eval(q/
for (i = 99; i > 0; i--) {
write(i + " bottle(s) of beer on the wall, " + i + " bottle(s) of beer\n");
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!");
}
}
/);

Generated packages:

Other version of this rpm: