🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

perl

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

perl

embed Perl5 to node.js

0.0.2
Source
npm
Version published
Weekly downloads
24
14.29%
Maintainers
1
Weekly downloads
 
Created
Source

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 = require('../index.js').Perl;
var perl = new Perl();
perl.use('LWP::UserAgent');
var ua = perl.getClass('LWP::UserAgent').new();
var res = ua.get('http://utf-8.jp/');
console.log(res.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/

Keywords

perl

FAQs

Package last updated on 28 Aug 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts