Subject: | Net::Jabber::Protocol default callbacks broken |
I believe that operating system and perl version are not significant in this case, so I'll omit them.
The problem is that callbackInit() method of Net::Jabber::Protocol never gets called when instantiating a Net::Jabber::Client. This happens because of a design error. Client is inherited from Net::XMPP::Client and Net::Jabber::Protocol. Net::XMPP::Client is in turn inherited from Net::XMPP::Connection which is inherited from Net::XMPP::Protocol. Both Net::XMPP::Protocol and Net::Jabber::Protocol have callbackInit() method, but Net::XMPP::Protocol has precedence because it is the first in the list. So only its callbackInit() gets called.
If you change the order of parents for Net::Jabber::Client, only Net::Jabber::Protocol get called and outputs an error, because SUPER is not meaningful there. Commenting the string out doesn't help, cause Net::XMPP::Protocol's callbackInit() definitely MUST be called for the things to operate.
I'm not really into perl, so I can't suggest a good solution of this problem. Workaround which works for me now is to rename Jabber's callbackInit() to something like callbackInit2() and to remove that SUPER call in it and call this callbackInit2() something explicitly in client's code. It then works. I'm perfectly sure that this solution is awfully ugly, so I'd kindly ask the author or somebody who understands perl and cpan's hierarchy to suggest a better one. Thanks.