You are mixing buffered operations (print, <$sock>, etc.) with select. This is a no-no. While it can sometimes work, it's probably not going to work well here.
You need to use sysread and syswrite (or send and recv, though the extra arguments are useless to you at this point). Autoflush is also not going to do any good, given it's for flushing buffers that you shouldn't be using.
If you were having a problem sysread/syswrite or send/recv then you should post the code that uses them, and ask questions about it.