in reply to unblocking sockets

This example comes from perldoc -f fcntl:

use Fcntl qw(F_GETFL F_SETFL O_NONBLOCK); $flags = fcntl(REMOTE, F_GETFL, 0) or die "Can't get flags for the socket: $!\n"; $flags = fcntl(REMOTE, F_SETFL, $flags | O_NONBLOCK) or die "Can't set flags for the socket: $!\n";
REMOTE there is the socket handle. You may need to dereference if you have a lexical handle ( *{$sock) ).

After Compline,