in reply to close STDOUT does not work, why?

Merlyn wrote Watching long processes through CGI (Aug 02) which may give you some ideas.

@_=qw; ask f00li5h to appear and remain for a moment of pretend better than a lifetime;;s;;@_[map hex,split'',B204316D8C2A4516DE];;y/05/os/&print;

Replies are listed 'Best First'.
Re^2: close STDOUT does not work, why?
by Anonymous Monk on Aug 25, 2007 at 18:49 UTC
    Hi Merlyn,

    Your example at Watching long processes through CGI (Aug 02) does not work if a person is running Apache ver 2.0 or later. I searched the web for the solution to this problem for awhile and found many references to your page and in other forums people also mentioned your example only prints out all the outputs when the Perl script finished but not while it is running. It would be helpful for others if somehow your example could be updated and include
    close STDIN;
    close STDERR;
    and reopens these standard IOs to NULL to make it work for later version of apache.
    Thanks for the reference though.

      Where are you suggesting those closes be put? perhaps as a diff/patch against the code listing or some line numbers would clarify your intent...

      It works as expected for me, when run as CGI in my userdir on Apache2, perhaps you're having issues with mod_perl or some other configuration issues?

      Running:

      @_=qw; ask f00li5h to appear and remain for a moment of pretend better than a lifetime;;s;;@_[map hex,split'',B204316D8C2A4516DE];;y/05/os/&print;