use Errno qw(EINTR); ... while (1) { $client = $socket->accept; if (!$client) { next if $! == EINTR; die "Error on accept: $!\n"; }