... use Errno qw( EINTR ); sub reaper { local ($!,$^E,$@); 1 while waitpid -1,&POSIX::WNOHANG != -1; $SIG{CHLD} = \&reaper; } $SIG{CHLD} = \&reaper; ... while (1) { my @ready = $select->can_read(); if (!@ready) { next if $! == EINTR; die "select: $!"; } handle($_) foreach @ready; }