in reply to Re^4: Multiplexing problem
in thread Multiplexing problem

new IO::Socket::INET->new(...)
should simply be
IO::Socket::INET->new(...)

If you have a buffering issue, just autoflush. For STDOUT, the following will do:

$|=1;

Your real problem is that sysread(STDIN,$msg_out,100); blocks.

I started writing a solution. But honestly, it would be much simpler to avoid select() and use threads.