in reply to Re: IO::Select woes
in thread IO::Select woes
This is a race condition between your processes.
The process left of the pipe has no STDIN defined, so it runs into the else path no matter what. And then... it terminates, closing its STDOUT during the process.
The process right of the pipe tries to read. If the "left" process has not yet terminated, it will find something readable (at EOF, though), and that's why you can make it work in the debugger or with extra print statements (a print to a pipe blocks until it is read). In most cases, however, the left process will already be gone before Perl is done parsing your script, which then doesn't see anything left on STDIN.
|
---|