perl.begin Starts a Perl code snippet
Usage
perl.begin [-n] [-q] [(<perl_context>[,<arg0>[,<arg1>[...]]])] <perl code> perl.end
Description

Indicates the beginning of a snippet of Perl code. The whole code part between perl.begin and perl.end is executed in a Perl interpreter. If perl.end is omitted then it is implicitly assumed that the code from perl.begin to the end of the command buffer is Perl.
Each Perl code execution is bound to a Perl context (that is in fact a particular instance of a Perl interpreter). If <perl_context> is not specified or it is an empty string then temporary Perl interpreter is created and destroyed just after the code snippet has terminated execution. If <perl_context> is specified then a Perl interpreter keyed to that context is used: if it was already existing then it is reused otherwise it is created. Any <perl_context> is persistent: it maintains the function declarations and Perl variable states until explicitly destroyed with perl.destroy (or the perlcore module is forcibly unloaded).
The <arg0>,<arg1>,... arguments, if present, are passed to the Perl code snippet in the @_ array (accessible as $_[0],$_[1]...).
The return value of the Perl code is propagated to the current context (just like setreturn was called on it) unless the -n switch is used.
The -q switch prevents from the command from printing any warning.
See the Perl scripting documentation for more information.

Switches

-q | --quiet
Prevents the command from printing any warnings.
-n | --no-return
Prevents the Perl script return value to be propagated to the current context.
-f | --fail-on-error
Treat Perl errors as KVS errors and abort execution of the current script. Incompatible with -q

Examples
perl.begin KVIrc::eval("echo \"Hello World from Perl!\""); perl.end

Index, Commands