sockets, you can set them to be non-blocking using C<fcntl>:
use Fcntl;
- fcntl(Connection, F_SETFL, O_NONBLOCK)
+ my $old_flags = fcntl($handle, F_GETFL, 0)
+ or die "can't get flags: $!";
+ fcntl($handle, F_SETFL, $old_flags | O_NONBLOCK)
or die "can't set non blocking: $!";
Rather than losing yourself in a morass of twisting, turning C<ioctl>s,