in reply to Re: Socket recv?
in thread Socket recv?

Please don't encourage people to use <> / readline on sockets. It is a great way to have things appear to lock up mysteriously (just because something arrived that didn't end in a newline character). It is a much better idea to read from a socket using read or sysread.

- tye        

Replies are listed 'Best First'.
Re^3: Socket recv? (read vs sysread)
by ikegami (Patriarch) on Mar 12, 2011 at 08:09 UTC

    read will block until the requested number of characters has arrived (if possible). (Not sure how that's different than readline.) select cannot be used in conjunction with read.

    sysread will block until data is present and return whatever data is present (up to the specified amount). sysread and select can work in concert.