PerlScalar - Encapsulate Perl SCALAR references in JavaScript
The ability to take references to stuff in perl is a basic language feature used by many perl modules. As such, it's important to be able to pass to javascript references to perl scalars and to create in javascript references to scalars.
Any unblessed SCALAR reference that you pass from perl to javascrip will be wrapped as an instance of PerlScalar, Blessed ones will be normally a PerlObject.
PerlScalar
You can construct from javascript new SCALAR references.
var ref = new PerlScalar(mystr);
Creates a perl scalar with a copy of somevalue and returns a new reference to it. If you pass this object to perl land it will be undistinguishable from a normal reference. somevalue can be any javascript primitive value.
somevalue
var value = ref.valueOf();
Retrive the value from the reference, the returned value will be a javascript primitive.
Returns the perl stringification for the reference. (Subject to change soon).
To install JSPL, copy and paste the appropriate command in to your terminal.
cpanm
cpanm JSPL
CPAN shell
perl -MCPAN -e shell install JSPL
For more information on module installation, please visit the detailed CPAN module installation guide.