Hi all,
I've read through the perldocs and browsed the web for quite a while, but I
can't seem to figure this one out.  My small snippet appears similar to the
examples I could find and the docs seem to back me up.  I believe I'm using
this correctly, but what happens is the 'bot' (written through PoCo::IRC)
just hangs in the channel.
if ( $sleep ) {
   $kernel->delay( cleanup => 5 ); # exit after n seconds
} else {
   &cleanup; # exit now if not sleeping
}

The cleanup function isn't doing anything real exciting.

sub cleanup {
  $_[KERNEL]->post( magnet => quit => "Bye.");
  $_[KERNEL]->post( magnet => unregister => "all" );
}

Pretty simple, but all of this is just a small test for something larger
that I want to write.  I didn't want to continue until I was sure I
understood this aspect of it.  If I run the 'cleanup' function all by
itself, it works fine and the 'bot' exits.  It's only when I try to call it
through the delay.

Thanks for any help you can provide!


Reply via email to