Please stop using recv. It works fine, but it has arguments you are almost certainly not using. Use sysread
instead.
sysread will return on short reads. Meaning you do have to pay attention to the return value; you are not guaranteed to get all that you asked for. As long as select says there's something to read, sysread will not block.
You are also, therefore, not guaranteed to get a full line on each sysread, so you will have to do your own buffering. Event.pm and POE are designed to abstract away most of these details, as it's tedious and error-prone to implement them yourself.