298 |
Perl scripts are loaded and unloaded with @command{/perl} command. |
Perl scripts are loaded and unloaded with @command{/perl} command. |
299 |
(type @kbd{/help perl} within WeeChat to get help about command).@* |
(type @kbd{/help perl} within WeeChat to get help about command).@* |
300 |
|
|
301 |
|
@emph{Examples:}@* |
302 |
@itemize @bullet |
@itemize @bullet |
303 |
@item |
@item |
304 |
Perl script loading example:@* |
Load a Perl script: @kbd{/perl load /tmp/sample.pl}@* |
|
@kbd{/perl load /tmp/sample.pl}@* |
|
305 |
@item |
@item |
306 |
Perl script unloading example:@* |
Unload all Perl scripts: @kbd{/perl unload}@* |
|
@kbd{/perl unload sample}@* |
|
|
Notice: "sample" is the first parameter of @command{IRC::register} function.@* |
|
307 |
@item |
@item |
308 |
List all Perl script loaded:@* |
List all Perl scripts: @kbd{/perl}@* |
|
@kbd{/perl}@* |
|
309 |
@end itemize |
@end itemize |
310 |
|
|
311 |
@subsection WeeChat / Perl API |
@subsection WeeChat / Perl API |
329 |
@* |
@* |
330 |
@emph{Example:}@* |
@emph{Example:}@* |
331 |
@code{IRC::register ("sample", "1.0", "sample_end", "Sample script!");}@* |
@code{IRC::register ("sample", "1.0", "sample_end", "Sample script!");}@* |
332 |
|
@* |
333 |
|
|
334 |
@item |
@item |
335 |
@command{IRC::print ( message );}@* |
@command{IRC::print ( message );}@* |
343 |
@* |
@* |
344 |
@emph{Example:}@* |
@emph{Example:}@* |
345 |
@code{IRC::print ("message");}@* |
@code{IRC::print ("message");}@* |
346 |
|
@* |
347 |
|
|
348 |
@item |
@item |
349 |
@command{IRC::add_message_handler ( name, function );}@* |
@command{IRC::add_message_handler ( name, function );}@* |
368 |
@code{@ @ @ @ ($hostmask, $null, $channel) = split " ", $channel;}@* |
@code{@ @ @ @ ($hostmask, $null, $channel) = split " ", $channel;}@* |
369 |
@code{@ @ @ @ IRC::print ("host=$hostmask, chan=$channel, msg=$message\n");}@* |
@code{@ @ @ @ IRC::print ("host=$hostmask, chan=$channel, msg=$message\n");}@* |
370 |
@code{@} }@* |
@code{@} }@* |
371 |
|
@* |
372 |
|
|
373 |
@item |
@item |
374 |
@command{IRC::add_command_handler ( name, function );}@* |
@command{IRC::add_command_handler ( name, function );}@* |
392 |
@code{@ @ @ @ IRC::print("Arguments: ".@@_[0]);}@* |
@code{@ @ @ @ IRC::print("Arguments: ".@@_[0]);}@* |
393 |
@code{@ @ @ @ return 0;}@* |
@code{@ @ @ @ return 0;}@* |
394 |
@code{@} }@* |
@code{@} }@* |
395 |
|
@* |
396 |
|
|
397 |
@end itemize |
@end itemize |
398 |
|
|