Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Sockets / IRC

by mindsport (Initiate)
on Sep 22, 2010 at 22:20 UTC ( [id://861386]=perlquestion: print w/replies, xml ) Need Help??

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!

Replies are listed 'Best First'.
Re: Sockets / IRC
by Anonymous Monk on Sep 22, 2010 at 22:51 UTC
      could you help me with an example of the select one? I wanted to not use the whole POE package with this small project

        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.

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://861386]
Approved by bingos
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-20 02:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found