package PluginDelay; use strict; use warnings; use POE; # import POE stuff use POE::Component::IRC::Plugin qw( :ALL ); # Plugin object constructor sub new { my ($package) = shift; return bless {}, $package; } sub PCI_register { my ( $self, $irc ) = splice @_, 0, 2; $irc->plugin_register( $self, 'SERVER', qw(public) ); # Register an object state handler # Try not to use something poco-irc already uses # using the name of your plugin is a good practise $poe_kernel->state( 'PluginDelay_alarm', $self ); # Set our initial alarm $kernel->delay( 'PluginDelay_alarm', 5 * 60 ); return 1; } # This is method is mandatory but we don't actually have anything to do. sub PCI_unregister { return 1; } sub PluginDelay_alarm { my ($kernel,$self,$irc) = @_[KERNEL,OBJECT,HEAP]; # Do something funky. # Set the next alarm up $kernel->delay( 'PluginDelay_alarm', 5 * 60 ); return; } 1;