POE-Component-IRC - 'register all' causes problems with 'unregister'

Posted on Sat Aug 19 01:39:59 2006 by jlh
'register all' causes problems with 'unregister'

I found out the hard way that the following doesn't work as I intuitively expected:

$kernel->post($irc => register => 'all'); $kernel->post($irc => unregister => 'mode');

It is not possible to unregister one (or more) events when you have registered 'all'. You can only unregister events that have explicitely been registered and 'all' can be unregistered, too. If you do like in above's code snippet, it seems some internal reference counting gets messed up (registering 'all' causes one reference to be created, and unregistering 'mode' causes it to be removed again, leaving you with none at all, as if no event had been registered at all) and you get odd results. Or something similar to that, I'm not very familiar with the internals.

This should be documented to not work as one might expect and in a future version of this module, making this work would be a useful addition.

(Using perl 5.8.7 and POE::Component::IRC 4.98)

Write a response