NAME
JavaScript::V8 - Perl interface to the V8
SYNOPSIS
use JavaScript::V8;
my $context = JavaScript::V8::Context->new();
$context->bind_function(write => sub { print @_; });
$context->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!");
}
}
/);
INSTALLING V8
See http://code.google.com/p/v8/issues/detail?id=413 if you are having trouble on gcc 4.4.1
svn checkout http://v8.googlecode.com/svn/trunk/ v8
cd v8
scons
sudo mv include/v8.h /usr/local/include/
sudo mv libv8.a /usr/local/lib/
REPOSITORY
The source code lives at http://github.com/pmurias/javascript-v8.
AUTHORS
Pawel Murias <pawelmurias at gmail dot com>
COPYRIGHT AND LICENSE
Copyright (c) 2009 Paweł Murias
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself
ACKNOWLEDGMENTS
- Claes Jakobsson <claesjac at cpan dot org> I stole and adapted pieces of docs and API design from JavaScript.pm
- Brian Hammond <brain @ fictorial dot com> For salvaging the code of V8.pm from a message board (which i took some code and the idea from)
- The hacker who wrote V8.pm and posted it on the message board (http://d.hatena.ne.jp/dayflower/20080905/1220592409)
- All the fine people at #perl@freenode.org for helping me write this module