http://www.perlmonks.org?node_id=928743


in reply to Re^4: Problem handling 2 simultaneous socket streams
in thread Problem handling 2 simultaneous socket streams

Use sysread instead of reading <>, I mentioned it in comments in the script. And be sure to add a timeout value to your select loop.
my $input; sysread( \*STDIN, $input, 1024);

Update: I forgot to mention you can set the nonblocking flag on STDIN

use Fcntl; fcntl(\*STDIN, F_SETFL, O_NONBLOCK) || die "$!\n"; # Set the non-block flags

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh