To create new wiki account, please join us on #znc at Libera.Chat and ask admins to create a wiki account for you. You can say thanks to spambots for this inconvenience.

Perleval: Difference between revisions

From ZNC
Jump to navigation Jump to search
No edit summary
 
Line 1: Line 1:
{{Core Module}}
{{Core Module}}


This module allows you to evaluate perl code. You need [[modperl]] installed and loaded to use it.
This module allows you to evaluate perl code. You need [[modperl]] installed and loaded to use it. Perleval is mostly useful when you are writing some other ZNC module using [[modperl]], and are playing around with ZNC APIs.


{{Module arguments}}
{{Module arguments}}

Latest revision as of 21:36, 5 August 2019


This module allows you to evaluate perl code. You need modperl installed and loaded to use it. Perleval is mostly useful when you are writing some other ZNC module using modperl, and are playing around with ZNC APIs.

Arguments

This user module takes no arguments.

Read loading modules to learn more about loading modules.

Usage

/msg *perleval code

$self is the perleval module itself. Look at modperl for details about perl in ZNC.

<DGandalf> 2 + 2
<*perleval> Result: 4
<DGandalf> my $x = 2; $x * 3
<*perleval> Result: 6
<DGandalf> $self->GetNetwork
<*perleval> Result: ZNC::CIRCNetwork=HASH(0x2b78450)
<DGandalf> $self->GetNetwork->GetName
<*perleval> Result: efnet
<DGandalf> $self->PutModule('hi')
<*perleval> hi
<*perleval> Result: 1
<DGandalf> $self->GetNetwork->PutIRC("NOTICE " . $self->GetNetwork->GetCurNick . " :hello")
<*perleval> Result: 1
*DGandalf* hello
<DGandalf> blahblah
<*perleval> Error: Bareword "blahblah" not allowed while "strict subs" in use at (eval 21) line 1.
<DGandalf> ZNC::CZNC::GetVersion()
<*perleval> Result: 0.207-git-507-c3f3ddd
<DGandalf> ZNC::CZNC::Get()->GetPemLocation
<*perleval> Result: /home/user/.znc/znc.pem