in reply to Waiting for input, without sleep
If you use sysread without an offset parameter, then it will always read into the start of your buffer. That means that if your server's response happened to turn up in more than one packet, you might trash the first bit of content with the second. I guess you might not see this if the responses are small enough to fit in one packet, but that's more by luck than judgement, especially if the data could be up to 4000 bytes in length.
Your algorithm for reading the response is a bit odd:
--
use JAPH;
print JAPH::asString();
|
|---|