use Errno qw( EINTR ); for (;;) { my $client = $server->accept(); if (!$client) { next if $! == EINTR; die("Can't accept: $!\n"); } ... }