The basic issue is that
<$rh> does a buffered read from the socket, meaning that it won't return from the read call until $/ (defaults to "\n") is encountered on the channel. IO::Select::can_read just means that there is data on the channel, it does not necessarily mean that there is a full record (defined as: a chunk terminated with an occurence of $/) waiting on the channel.
The proper solution is either to change (locally) the value of $/ to whatever makes sense for the records you are sending accross the channel... if you are willing to rely on the fact that only complete records get sent (otherwise you can gum up the process with blocking incomplete buffered reads), OR to change it from a buffering read to a non-buffering read (the better but more involved solution). For that, take a look at perldoc -f sysread for more details.
------------
:Wq
Not an editor command: Wq