| 1 |
NAME |
| 2 |
POE::Filter::IRCD - A POE-based parser for the IRC protocol |
| 3 |
|
| 4 |
VERSION |
| 5 |
version 2.44 |
| 6 |
|
| 7 |
SYNOPSIS |
| 8 |
use POE::Filter::IRCD; |
| 9 |
|
| 10 |
my $filter = POE::Filter::IRCD->new( debug => 1, colonify => 0 ); |
| 11 |
my $arrayref = $filter->get( [ $hashref ] ); |
| 12 |
my $arrayref2 = $filter->put( $arrayref ); |
| 13 |
|
| 14 |
use POE qw(Filter::Stackable Filter::Line Filter::IRCD); |
| 15 |
|
| 16 |
my ($filter) = POE::Filter::Stackable->new(); |
| 17 |
$filter->push( POE::Filter::Line->new( InputRegexp => '\015?\012', OutputLiteral => "\015\012" ), |
| 18 |
POE::Filter::IRCD->new(), ); |
| 19 |
|
| 20 |
DESCRIPTION |
| 21 |
POE::Filter::IRCD provides a convenient way of parsing and creating IRC |
| 22 |
protocol lines. It provides the parsing engine for |
| 23 |
POE::Component::Server::IRC and POE::Component::IRC. A standalone |
| 24 |
version exists as Parse::IRC. |
| 25 |
|
| 26 |
CONSTRUCTOR |
| 27 |
"new" |
| 28 |
Creates a new POE::Filter::IRCD object. Takes two optional |
| 29 |
arguments: |
| 30 |
|
| 31 |
'debug', which will print all lines received to STDERR; |
| 32 |
'colonify', set to 1 to force the filter to always colonify the last param passed in a put(), |
| 33 |
default is 0. See below for more detail. |
| 34 |
|
| 35 |
METHODS |
| 36 |
"get_one_start" |
| 37 |
"get_one" |
| 38 |
"get_pending" |
| 39 |
"get" |
| 40 |
Takes an arrayref which is contains lines of IRC formatted input. |
| 41 |
Returns an arrayref of hashrefs which represents the lines. The |
| 42 |
hashref contains the following fields: |
| 43 |
|
| 44 |
prefix |
| 45 |
command |
| 46 |
params ( this is an arrayref ) |
| 47 |
raw_line |
| 48 |
|
| 49 |
For example, if the filter receives the following line, the |
| 50 |
following hashref is produced: |
| 51 |
|
| 52 |
LINE: ':moo.server.net 001 lamebot :Welcome to the IRC network lamebot' |
| 53 |
|
| 54 |
HASHREF: { |
| 55 |
prefix => ':moo.server.net', |
| 56 |
command => '001', |
| 57 |
params => [ 'lamebot', 'Welcome to the IRC network lamebot' ], |
| 58 |
raw_line => ':moo.server.net 001 lamebot :Welcome to the IRC network lamebot', |
| 59 |
} |
| 60 |
|
| 61 |
"put" |
| 62 |
Takes an arrayref containing hashrefs of IRC data and returns an |
| 63 |
arrayref containing IRC formatted lines. Optionally, one can specify |
| 64 |
'colonify' to override the global colonification option. eg. |
| 65 |
|
| 66 |
$hashref = { |
| 67 |
command => 'PRIVMSG', |
| 68 |
prefix => '[email protected]', |
| 69 |
params => [ '#foobar', 'boo!' ], |
| 70 |
colonify => 1, # Override the global colonify option for this record only. |
| 71 |
}; |
| 72 |
|
| 73 |
$filter->put( [ $hashref ] ); |
| 74 |
|
| 75 |
"clone" |
| 76 |
Makes a copy of the filter, and clears the copy's buffer. |
| 77 |
|
| 78 |
"debug" |
| 79 |
With a true or false argument, enables or disables debug output |
| 80 |
respectively. Without an argument the behaviour is to toggle the |
| 81 |
debug status. |
| 82 |
|
| 83 |
SEE ALSO |
| 84 |
POE |
| 85 |
|
| 86 |
POE::Filter |
| 87 |
|
| 88 |
POE::Filter::Stackable |
| 89 |
|
| 90 |
POE::Component::Server::IRC |
| 91 |
|
| 92 |
POE::Component::IRC |
| 93 |
|
| 94 |
Parse::IRC |
| 95 |
|
| 96 |
AUTHOR |
| 97 |
Chris Williams <[email protected]> |
| 98 |
|
| 99 |
COPYRIGHT AND LICENSE |
| 100 |
This software is copyright (c) 2013 by Chris Williams and Jonathan |
| 101 |
Steinert. |
| 102 |
|
| 103 |
This is free software; you can redistribute it and/or modify it under |
| 104 |
the same terms as the Perl 5 programming language system itself. |
| 105 |
|