while (my $c = $d->accept) { while (my $r = $c->get_request) { my $pid = fork; next unless defined $pid; if ($pid) { print "forked child $pid\n"; } else { print "child $$, handling request\n"; sleep 5; print $c "Status 200 OK\n"; exit; } } }