Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Node perl wrapper
branch: namedproperty

This branch is 5 commits ahead, 40 commits behind master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
eg
src
test
.gitignore
HACKING.mkdn
README.mkdn
index.js
package.json
wscript

README.mkdn

Simple but useful embed Perl for node.js

SYNOPSIS

var Perl = require('perl-simple').Perl;
var perl = new Perl();
var ret = perl.evaluate("reverse 'yappo'");
console.log(ret); // => oppay

var perl = new Perl();
perl.use('LWP::UserAgent');
var ua = perl.getClass('LWP::UserAgent').call('new');
var res = ua.call('get', 'http://mixi.jp/');
console.log(res.call('as_string'));

Classes

require('perl-simple').Perl

var perl = new Perl()

Create new instance of Perl.

var retval = perl.evaluate(Str code)

evaluate the perl code and get a return value.

var klass = perl.getClass(Str name)

Get a class object(Instance of PerlClass) from perl.

var klass = Perl.blessed(obj)

Same as Scalar::Util::blessed.

var val = perl[funcname]

Get a PerlMethod object.

require('perl-simple').PerlObject

var val = obj[funcname]

Get a PerlMethod object.

require('perl-simple').PerlClass

You can get a instance of this class by Perl#getClass.

var val = klass[funcname]

Get a PerlMethod object.

require('perl-simple').PerlMethod

var val = method()

Call perl5 function and get a return value in scalar context. You get a exception when Perl5 throws exception.

var val = method.callList()

Same as above, but callList calls function in list context.

Notes

  • perl call is a synchronous.

Enhancements

You can implement better interface by Harmony-Proxy.

THANKS TO

Based on https://github.com/hideo55/node-perl.

License

http://tokuhirom.mit-license.org/

Something went wrong with that request. Please try again.