This is just a wag...
<$socket> is going to buffer (and hang) until Perl gets what it's expecting for an end of line char. Mabye the server didn't end it's reply with a \n and <$socket> is still waiting for it?
Mixing 'print' and 'sysread' on the same filehandle is not recommended, and maybe the reason why this is hanging as well. Maybe replacing print with syswrite will get things flowing again.