zedar has asked for the wisdom of the Perl Monks concerning the following question:
then after that i have the usualfor ($count=0;$count<5;$count++){ unless (defined ($pid[$count] = fork)) { print "im dying\n"; die "cannot fork: $!"; } unless ($pid[$count]) { print "im a kid with pid $$\n"; `do my thing`; exit; #child stops ehre } } # Parent continues here
along with the rest of the html, not in a loop or anything and only starting after all child processes have finished. The output im getting in the brower is in the form ofprint "Content-Type:text/html\n\n"; print $q->pre("Will be tracing to $trace<BR>\n"); print ("your coming from $ENV{REMOTE_ADDR}<BR>\n");
where 1,2,3,4 are the first few lines of html. When run from the shell though it runs perfectly, this only happens in browsers.. is there something about the forking im missing? thanks Andre1 1 2 1 2 3 1 2 3 4
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: CGI printing output x times, where x is the number of forks.
by Anonymous Monk on May 08, 2001 at 08:08 UTC |