.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "POE::Filter::IRCD 3pm" .TH POE::Filter::IRCD 3pm "2018-03-30" "perl v5.26.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" POE::Filter::IRCD \- A POE\-based parser for the IRC protocol .SH "VERSION" .IX Header "VERSION" version 2.44 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use POE::Filter::IRCD; \& \& my $filter = POE::Filter::IRCD\->new( debug => 1, colonify => 0 ); \& my $arrayref = $filter\->get( [ $hashref ] ); \& my $arrayref2 = $filter\->put( $arrayref ); \& \& use POE qw(Filter::Stackable Filter::Line Filter::IRCD); \& \& my ($filter) = POE::Filter::Stackable\->new(); \& $filter\->push( POE::Filter::Line\->new( InputRegexp => \*(Aq\e015?\e012\*(Aq, OutputLiteral => "\e015\e012" ), \& POE::Filter::IRCD\->new(), ); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" POE::Filter::IRCD provides a convenient way of parsing and creating \s-1IRC\s0 protocol lines. It provides the parsing engine for POE::Component::Server::IRC and POE::Component::IRC. A standalone version exists as Parse::IRC. .SH "CONSTRUCTOR" .IX Header "CONSTRUCTOR" .ie n .IP """new""" 4 .el .IP "\f(CWnew\fR" 4 .IX Item "new" Creates a new POE::Filter::IRCD object. Takes two optional arguments: .Sp .Vb 3 \& \*(Aqdebug\*(Aq, which will print all lines received to STDERR; \& \*(Aqcolonify\*(Aq, set to 1 to force the filter to always colonify the last param passed in a put(), \& default is 0. See below for more detail. .Ve .SH "METHODS" .IX Header "METHODS" .ie n .IP """get_one_start""" 4 .el .IP "\f(CWget_one_start\fR" 4 .IX Item "get_one_start" .PD 0 .ie n .IP """get_one""" 4 .el .IP "\f(CWget_one\fR" 4 .IX Item "get_one" .ie n .IP """get_pending""" 4 .el .IP "\f(CWget_pending\fR" 4 .IX Item "get_pending" .ie n .IP """get""" 4 .el .IP "\f(CWget\fR" 4 .IX Item "get" .PD Takes an arrayref which is contains lines of \s-1IRC\s0 formatted input. Returns an arrayref of hashrefs which represents the lines. The hashref contains the following fields: .Sp .Vb 4 \& prefix \& command \& params ( this is an arrayref ) \& raw_line .Ve .Sp For example, if the filter receives the following line, the following hashref is produced: .Sp .Vb 1 \& LINE: \*(Aq:moo.server.net 001 lamebot :Welcome to the IRC network lamebot\*(Aq \& \& HASHREF: { \& prefix => \*(Aq:moo.server.net\*(Aq, \& command => \*(Aq001\*(Aq, \& params => [ \*(Aqlamebot\*(Aq, \*(AqWelcome to the IRC network lamebot\*(Aq ], \& raw_line => \*(Aq:moo.server.net 001 lamebot :Welcome to the IRC network lamebot\*(Aq, \& } .Ve .ie n .IP """put""" 4 .el .IP "\f(CWput\fR" 4 .IX Item "put" Takes an arrayref containing hashrefs of \s-1IRC\s0 data and returns an arrayref containing \s-1IRC\s0 formatted lines. Optionally, one can specify 'colonify' to override the global colonification option. eg. .Sp .Vb 6 \& $hashref = { \& command => \*(AqPRIVMSG\*(Aq, \& prefix => \*(AqFooBar!foobar@foobar.com\*(Aq, \& params => [ \*(Aq#foobar\*(Aq, \*(Aqboo!\*(Aq ], \& colonify => 1, # Override the global colonify option for this record only. \& }; \& \& $filter\->put( [ $hashref ] ); .Ve .ie n .IP """clone""" 4 .el .IP "\f(CWclone\fR" 4 .IX Item "clone" Makes a copy of the filter, and clears the copy's buffer. .ie n .IP """debug""" 4 .el .IP "\f(CWdebug\fR" 4 .IX Item "debug" With a true or false argument, enables or disables debug output respectively. Without an argument the behaviour is to toggle the debug status. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\s-1POE\s0 .PP POE::Filter .PP POE::Filter::Stackable .PP POE::Component::Server::IRC .PP POE::Component::IRC .PP Parse::IRC .SH "AUTHOR" .IX Header "AUTHOR" Chris Williams .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is copyright (c) 2013 by Chris Williams and Jonathan Steinert. .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.