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