while() { my $ret=accept($client,$server); next if (not defined($ret)); . . }