Sophie

Sophie

distrib > Mandriva > current > i586 > media > contrib-release > by-pkgid > 2fd5d780034d52b9392066e80936290d

perl-JavaScript-1.160.0-1mdv2010.1.i586.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!");
}
}
/);

Sources packages:

Other version of this rpm: