Perl-Sensitive Sunglasses | |
PerlMonks |
unbuffered read from socketby Forsaken (Friar) |
on Dec 28, 2004 at 23:42 UTC ( [id://417886]=perlquestion: print w/replies, xml ) | Need Help?? |
Forsaken has asked for the wisdom of the Perl Monks concerning the following question: esteemed monks, i beg for another moment of your valuable time still tinkering around with my irc scripts... ;-) situation is as follows. i have a number of socket connections open, which are managed by IO::Select in order for me to know which ones have data waiting to be read. the data itself comes from an irc server and thus follows a predictable pattern, in that the traffic is composed by lines followed by \n, so i know what i can expect. right now i am using the following to read the data one line at a time:
after which $line gets processed and the whole thing starts all over again. somehow this reading 1 char at a time seems really cumbersome, not to mention prone to problems in case of unforeseen circumstances. I would highly appreciate your insight on this matter.
Update:
Back to
Seekers of Perl Wisdom
|
|