use Errno qw( EINTR ); do { while (my $client = $sock->accept()) { ... } } while ($! == EINTR);