I wanted to see if I could run a POE::Component::IRC bot inside Irssi.
I had a bot called flibblebot that I have been playing with on Freenode for a while. So I took the source to that and started fiddling.
First I switched the POE::Session to use POE::Session::Irssi. Then had to change all my handlers to inline_state from package, as POE::Session::Irssi currently doesn't support object or package state handlers. Suck.
Then I started the script up in Irssi and it worked! Hurrah!
Except that I had left in print statements that spat debug info into my active Irssi window
Try to unload the script to find, that bot won't die. Damn it, POE::Component::IRC is not Irssi aware and is holding the POE::Session::Irssi open. Then I remembered that one can send PoCo-IRC a 'POCOIRC_SHUTDOWN' signal to tell it to
Right, I need to bind an Irssi command to terminate the bot
The final bot code is here
I have since been corrected about package_states. Irssi wraps scripts as Irssi::Script::scriptname-minus-pl I have adjusted the bot code accordingly