Hello
Let me summarize your problem. You have an IRC bot (uses Net::IRC) and it has an event loop in which events are fired and handlers are dispatched. HTTP::Daemon also has an event loop and the two event loops do not mix. How do you get both event loops running while still communicating between the processes?
Here is one simple way: do not run an httpd, instead use an off the shelf web server (apache), and let the bot dump the stats in files accessible by the server. Here the stats won't be real-time, but it might be okay for your application.
Another way (also simple) is to have a cgi-script (one that provides the stats) use Net::IRC to contact the bot (via DCC perhaps) and pull all the information. This was is still simpler than mixing the processes together, but there is some small overhead as the cgi script needs to contact the bot (kinda IPC through DCC).
This is all I can think of at the moment to make your life easier. Any other way might be too complicated for an IRC toy.
Hope this helps,,,
Aziz,,, | [reply] |
| [reply] |
So I went to CPAN, found HTTP::Daemon and everything was fine, until I realized that my bot wasn't joining any channels anymore.
How about giving us something more to work with (like some code). Otherwise, we're forced to fill in a lot of the pieces from the meager info you've provided.
If (and I'm guessing here) you're writing a plugin that needs to make a web request and parse the results, there are, I believe, example plugins to base your work on. The "purl" bot on the old efnet #perl channel had a google plugin. Look through the existing Net::IRC plugins to see if there's already one that does the same thing you're trying to do.
| [reply] |