while (1) { my $new_handle = $sock->accept; my $pid = fork; if (defined($pid) && $pid == 0) { ...child executes here... } }