Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
However, as you can see, I don't close the STDOUT or STDIN in the child process even though you are supposed to using the below code:defined(my $pid = fork) or die "Can't fork: $!"; if ($pid) { print "waiting"; waitpid($pid,0); print "done waiting"; } else { my $result= new CGI; print $result->redirect("redirection"); }
How big of a problem can this cause? Eliminating the above two lines seems to be the only way to get the output in a child process to output to the browser.open STDIN, "</dev/null"; open STDOUT, ">/dev/null";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: forking efficiency
by setantae (Scribe) on Jan 14, 2001 at 04:41 UTC | |
by kuce (Novice) on Jan 14, 2001 at 04:58 UTC | |
|
Re: forking efficiency
by merlyn (Sage) on Jan 14, 2001 at 08:46 UTC |