Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Im writing an irc bot and I would like to know if my value to sysread is too high. Or should I go higher? is there a way to tell if my read value is efficient or not?
if(sysread(SOCK,$buf,1024)){ print $buf,"\n"; }

Replies are listed 'Best First'.
Re: sysread && IRC
by abstracts (Hermit) on Aug 15, 2001 at 00:33 UTC
    Hello

    For a line protocol such as IRC, I would not even use sysread. Sysread is more suitable for reading large chuncks of data. If you use sysread, you'll have to worry about splitting your data correctly, handling incomplete lines, and so forth. Just use the normal <SOCK> to get one line at a time.

    And just in case you don't know about it, there is a module called Net::IRC which is ideal for making irc bots. Using it is straight forward and you wouldn't need to worry about all the rfc's ins and outs.

    Hope this helps,,,

    Aziz,,,