mindsport has asked for the wisdom of the Perl Monks concerning the following question:
Was not too sure of how to word my question to search it on google but I wrote a little irc client to connect to irc and join a channel and while its in the channel I want it to read a website and post new updates to the channel but the while loop for the socket only is active when the server is sending information to it.. how can I have just a while loop for processing the webpage at a certain time and also one to read the incoming data from the server? Thanks!
Re: Sockets / IRC
by Anonymous Monk on Sep 22, 2010 at 22:51 UTC
|
| [reply] |
|
could you help me with an example of the select one? I wanted to not use the whole POE package with this small project
| [reply] |
|
If you really want to do it yourself, I'd recommend using IO::Select, which even has a example in the documentation. Keep in mind that you'll need to implement the relevant RFCS.
The easy way out is to use POE or AnyEvent::IRC::Client.
| [reply] |
Re: Sockets / IRC
by Proclus (Beadle) on Sep 23, 2010 at 12:07 UTC
|
You should really try POE as suggested. It is very easy to install and will not give you much overhead. Instead, it will give your code consistency and simplicity in addition to providing a nonblocking environment.
| [reply] |
|