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

From ZNC
Revision as of 21:36, 5 August 2019 by DarthGandalf (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


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