skazat has asked for the wisdom of the Perl Monks concerning the following question:
Hello all, I have a cgi script that forks() a process, the script outputs html, but does so twice. looking in the Camel book its says:
Note that unflushed buffers remain unflushed in both processes, which means you may need to set $| on one or more filehandles earlier in the program to avoid duplicate output.
Ok, easy enough. STDOUT is set to 1 ($| = 1) in the main script, what would I set the $| in the forked process? The way I've gotten around this before is to close STDOUT in the forked process, but that gives me a bunch of warnings that I don't want.
anyone hae the quick answer?
-justin simoni
!skazat!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Duplicate Output with forking
by dws (Chancellor) on Mar 21, 2001 at 03:31 UTC | |
by skazat (Chaplain) on Mar 21, 2001 at 03:49 UTC | |
by dws (Chancellor) on Mar 21, 2001 at 03:56 UTC | |
by skazat (Chaplain) on Mar 21, 2001 at 04:20 UTC |