in reply to Reading an incoming Data Stream..
$| = 1; ### Enable Autoflushing of I/O.
Should be...
$| = 1; ### Enable Autoflushing of current STDOUT + filehandle
Later on in your code development it's not going to turn on Autoflushing on your sockets. Just in case you didn't know. (i'm picky at the moment).
In Section
Seekers of Perl Wisdom