my $d = HTTP::Daemon->new( LocalPort => $self->port(), ReuseAddr => 1, ); $SIG{CLD} = $SIG{CHLD} = 'IGNORE'; while (my $c = $d->accept()) { next if(fork()); $SIG{CLD} = $SIG{CHLD} = 'DEFAULT'; #Reset child signal handler while (my $r = $c->get_request()) { # ... do stuff here, including a system() call } $c->close; undef($c); exit(0); }