1POE::Filter::IRCD(3)  User Contributed Perl Documentation POE::Filter::IRCD(3)
2
3
4

NAME

6       POE::Filter::IRCD - A POE-based parser for the IRC protocol.
7

SYNOPSIS

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

DESCRIPTION

22       POE::Filter::IRCD provides a convenient way of parsing and creating IRC
23       protocol lines. It provides the parsing engine for
24       POE::Component::Server::IRC and POE::Component::IRC.  A standalone
25       version exists as Parse::IRC.
26

CONSTRUCTOR

28       "new"
29           Creates a new POE::Filter::IRCD object. Takes two optional
30           arguments:
31
32             'debug', which will print all lines received to STDERR;
33             'colonify', set to 1 to force the filter to always colonify the last param passed in a put(),
34                         default is 0. See below for more detail.
35

METHODS

37       "get_one_start"
38       "get_one"
39       "get_pending"
40       "get"
41           Takes an arrayref which is contains lines of IRC formatted input.
42           Returns an arrayref of hashrefs which represents the lines. The
43           hashref contains the following fields:
44
45             prefix
46             command
47             params ( this is an arrayref )
48             raw_line
49
50           For example, if the filter receives the following line, the
51           following hashref is produced:
52
53             LINE: ':moo.server.net 001 lamebot :Welcome to the IRC network lamebot'
54
55             HASHREF: {
56                           prefix   => ':moo.server.net',
57                           command  => '001',
58                           params   => [ 'lamebot', 'Welcome to the IRC network lamebot' ],
59                           raw_line => ':moo.server.net 001 lamebot :Welcome to the IRC network lamebot',
60                      }
61
62       "put"
63           Takes an arrayref containing hashrefs of IRC data and returns an
64           arrayref containing IRC formatted lines.  Optionally, one can
65           specify 'colonify' to override the global colonification option.
66           eg.
67
68             $hashref = {
69                           command => 'PRIVMSG',
70                           prefix => 'FooBar!foobar@foobar.com',
71                           params => [ '#foobar', 'boo!' ],
72                           colonify => 1, # Override the global colonify option for this record only.
73                         };
74
75             $filter->put( [ $hashref ] );
76
77       "clone"
78           Makes a copy of the filter, and clears the copy's buffer.
79
80       "debug"
81           With a true or false argument, enables or disables debug output
82           respectively. Without an argument the behaviour is to toggle the
83           debug status.
84

MAINTAINER

86       Chris Williams <chris@bingosnet.co.uk>
87

AUTHOR

89       Jonathan Steinert
90

LICENSE

92       Copyright X Chris Williams and Jonathan Steinert
93
94       This module may be used, modified, and distributed under the same terms
95       as Perl itself. Please see the license that came with your Perl
96       distribution for details.
97

SEE ALSO

99       POE
100
101       POE::Filter
102
103       POE::Filter::Stackable
104
105       POE::Component::Server::IRC
106
107       POE::Component::IRC
108
109       Parse::IRC
110
111
112
113perl v5.12.2                      2009-12-11              POE::Filter::IRCD(3)
Impressum