POE::Component::IRC::Plugin::Role - A Moose role for POE::Component::IRC plugins
package My::Plugin; use Moose; use POE::Component::IRC::Plugin qw(:ALL); with 'POE::Component::IRC::Plugin::Role'; # PCI_register and PCI_unregister are automatically dealt with sub S_001 { my $self = shift; $self->irc->yield( 'join', '#channel' ); return PCI_EAT_NONE; } 1;
POE::Component::IRC::Plugin::Role is a Moose role that encapsulates some of the boilerplate required to write POE::Component::IRC plugins with Moose.
Simply consume the role in your Moose based plugins.
irc
Should be a POE::Component::IRC object. It can not be set in the constructor, but has set_irc and clear_irc writer and clearer methods, respectively. It is usually set for you by PCI_register and cleared by PCI_unregister methods.
set_irc
clear_irc
PCI_register
PCI_unregister
S_events
An arrayref of SERVER events to register for when PCI_Register is called. The default is to register events for the S_* prefixed methods in your module.
SERVER
PCI_Register
S_*
U_events
An arrayref of USER events to register for when PCI_register is called. The default is to register events for the U_* prefixed methods in your module.
USER
U_*
This is called everytime a plugin object is added to POE::Component::IRC. It will set the irc attribute and register for the requested S_events and U_events.
This is called everytime a plugin object is removed from POE::Component::IRC. It will clear the irc attribute.
Chris BinGOs Williams <chris@bingosnet.co.uk>
BinGOs
Chris Prather
Shawn M Moore
Copyright © Chris Williams
This module may be used, modified, and distributed under the same terms as Perl itself. Please see the license that came with your Perl distribution for details.
POE::Component::IRC
POE::Component::IRC::Plugin
Moose::Role
To install POE::Component::IRC::Plugin::Role, copy and paste the appropriate command in to your terminal.
cpanm
cpanm POE::Component::IRC::Plugin::Role
CPAN shell
perl -MCPAN -e shell install POE::Component::IRC::Plugin::Role
For more information on module installation, please visit the detailed CPAN module installation guide.