in reply to Capturing STDOUT

Apache/CGI works magic with STDOUT. You need something like:
tie *LOCALFH, 'IO::Scalar', \$scalar; my $old_fh = select(LOCALFH); ...code that generates STDOUT... select $old_fh;
Don't assume anything about the current default filehandle.

rdfield

Replies are listed 'Best First'.
Re: Re: Capturing STDOUT
by drewbie (Chaplain) on Nov 05, 2002 at 14:45 UTC
    That is what I ended up doing (without capturing the old default filehandle). However, what I'd like to know is what magic was going on that allowed me to tie STDOUT initially, but was preventing the untie from working. I figure out that the initial tie()'ing of STDOUT was successful, but the untie never was.