|Don't ask to ask, just ask
Closing STDIO Caused Pipe Not To Workby Anonymous Monk
|on Aug 26, 2007 at 22:31 UTC
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Dear Perl Monk,
A few days ago I posted a question "close STDOUT does not work, why?" at close STDOUT does not work, why?
and BrowserUK pointed out that I needed to close STDIN and STDERR as well and it made the redirection worked. However, when I tried to invoke an external program using PIPE later in my program, it failed. Below is a piece of code I wrote to demonstrate my problem. Any thoughts?
The problem occurs at
I tried to put a print STDERR "I am here"; and noticed it does print to the
error_log file if I put the print statement above the open PIPE but does not if
I put the print statement after it. Any thoughts?