Overall, good stuff. But I think you better doublecheck
that "Perl will read a few bytes ahead to improve
performance" claim. I don't recall coming across that
anywhere else before. In particular, I've used
print and
<> with sockets before
with no problems. The key is to not mix them with
sysread and
syswrite.
Also, I think IO::Socket and IO::Select deserve more space.
After becoming comfortable with them, I far prefer them
over the raw Perl stuff, which looks more like C than Perl.
There's a good example of both IO::Socket and IO::Select
at the end of perldoc IO::Select. Of course, it should be
noted that the major limitation of IO::Select is that it
doesn't allow you to wait for reading,
writing, and exceptions simultaneously. You have to pick
one. But, for the example you show, that's not a limitation.
Finally, one minor thing: "get all the data it wants before
continue" should be "...continuing".
But, overall, pretty good stuff. Have a Scooby snack on me.
*Woof*