This plugins automatically install the following services in the global object of every context created in the referenced runtime.
To use any of the methods marked as Restricted you must call in a unrestricted context, otherwise the method invocation throws an error.
Alias to the global object,
so if in a different scope you need to reference any of the following services,
you can use
Sys. as a prefix.
Think in the
window object when in the browser.
The environment variables under which your program is running. You can change the properties on this object to modify the environment.
This object is an alias to perl's "%ENV" in perlvar.
Used to aggregate all properties related to I/O
Returns a new instance of a IO::File opened for read/write on a newly created temporary file. On systems where this is possible, the temporary file is anonymous (i.e. it is unlinked after creation, but held open).
Write to STDOUT. Alias to "print" in perlfunc.
Returns a string formatted by the usual "printf" conventions of the C library function "sprintf". This is implemented by "sprintf" in perlfunc.
Perl eval. Eval the STRING as perl code using "eval" in perlfunc. Returns the value of the last statement in STRING. If perl's eval fails, throws an exception.
Alias for perl's "system" in perlfunc.
Alias for perl's "caller" in perlfunc.
The value bound will be either a
PerlSub if a constructor was found in the perl package or a
You must read the discussion on "install" in JSPL::Controller.
Example, requiring a package with a constructor:
require('INET', 'IO::Socket::INET'); // INET instanceOf PerlSub === true var conn = new INET(...);
Stash is bound it can be used to call class methods on it, among other things.
Example, requiring a package without a constructor:
require('DBI', 'DBI'); var conn = DBI.connect(...);
The require service described above is actually implemented in terms of two lower-level services: load and install.
The load service makes the given list of perl libraries to be loaded in the perl side. The return value of load is the number of modules loaded. If a module fails to load an exception will be thrown.
As discussed above,
require is defined in terms of
install. Install makes a perl module to be available on the perl side. The module should be previously been loaded using "load". You should read the discussion on "install" in JSPL::Controller.
Separating the "load" and the
Emit a warning message to STDERR. Alias to "warn" in perlfunc.