in reply to Multiple outputs in a CGI script
I've not tested this, but it should do the trick. If you get output in the wrong sequence, the some of the output is being buffered somewhere along the line. Setting $| should keep that from happening...# unbuffer STDOUT $| = 1; open(TEE, "| tee $filename") || die "Can't open pipe: $!"; # unbuffer output to the pipe. select(TEE); $| = 1; select(STDOUT); print TEE "some stuff that goes both places\n"; print "some stuff that goes to the browser\n"; print TEE "some more stuff that goes places\n";
/\/\averick
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE (2): Multiple outputs in a CGI script
by tilly (Archbishop) on Aug 09, 2000 at 23:45 UTC | |
by maverick (Curate) on Aug 09, 2000 at 23:54 UTC |