use Fcntl; fcntl(Connection, F_SETFL, O_NONBLOCK) or die "can't set non blocking: $!";