1POE::Filter::IRCD(3) User Contributed Perl Documentation POE::Filter::IRCD(3)
2
3
4
6 POE::Filter::IRCD -- A POE-based parser for the IRC protocol.
7
9 use POE::Filter::IRCD;
10
11 my $filter = POE::Filter::IRCD->new( DEBUG => 1, colonify => 0 );
12 my $arrayref = $filter->get( [ $hashref ] );
13 my $arrayref2 = $filter->put( $arrayref );
14
15 use POE qw(Filter::Stackable Filter::Line Filter::IRCD);
16
17 my ($filter) = POE::Filter::Stackable->new();
18 $filter->push( POE::Filter::Line->new( InputRegexp => '\015?\012', OutputLiteral => "\015\012" ),
19 POE::Filter::IRCD->new(), );
20
22 POE::Filter::IRCD provides a convenient way of parsing and creating IRC
23 protocol lines. It provides the parsing engine for POE::Compo‐
24 nent::Server::IRC and POE::Component::IRC. A standalone version exists
25 as Parse::IRC.
26
28 new Creates a new POE::Filter::IRCD object. Takes two optional argu‐
29 ments:
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
36 get_one_start
37 get_one
38 get_pending
39 get Takes an arrayref which is contains lines of IRC formatted input.
40 Returns an arrayref of hashrefs which represents the lines. The
41 hashref contains the following fields:
42
43 prefix
44 command
45 params ( this is an arrayref )
46 raw_line
47
48 For example, if the filter receives the following line, the follow‐
49 ing hashref is produced:
50
51 LINE: ':moo.server.net 001 lamebot :Welcome to the IRC network lamebot'
52
53 HASHREF: {
54 prefix => ':moo.server.net',
55 command => '001',
56 params => [ 'lamebot', 'Welcome to the IRC network lamebot' ],
57 raw_line => ':moo.server.net 001 lamebot :Welcome to the IRC network lamebot',
58 }
59
60 put Takes an arrayref containing hashrefs of IRC data and returns an
61 arrayref containing IRC formatted lines. Optionally, one can spec‐
62 ify 'colonify' to override the global colonification option. eg.
63
64 $hashref = {
65 command => 'PRIVMSG',
66 prefix => 'FooBar!foobar@foobar.com',
67 params => [ '#foobar', 'boo!' ],
68 colonify => 1, # Override the global colonify option for this record only.
69 };
70
71 $filter->put( [ $hashref ] );
72
73 debug
74 With a true or false argument, enables or disables debug output
75 respectively. Without an argument the behaviour is to toggle the
76 debug status.
77
79 Chris Williams <chris@bingosnet.co.uk>
80
82 Jonathan Steinert
83
85 POE
86
87 POE::Filter
88
89 POE::Filter::Stackable
90
91 POE::Component::Server::IRC
92
93 POE::Component::IRC
94
95 Parse::IRC
96
97
98
99perl v5.8.8 2006-10-29 POE::Filter::IRCD(3)