http://www.perlmonks.org?node_id=980005


in reply to Open3 doesn't work in a sub-routine

It may not be an issue for the cases you are dealing with, but what if the command you run produces enough output to STDERR to fill the pipe before it closes STDOUT, and blocks writing STDERR. Then you will be stuck in the loop on STDOUT, waiting for that to finish, never reading STDERR, and the command will never finish because it is waiting to write to STDERR - deadlock.

You might have a look at select.

  • Comment on Re: Open3 doesn't work in a sub-routine

Replies are listed 'Best First'.
Re^2: Open3 doesn't work in a sub-routine
by Anonymous Monk on Jul 05, 2012 at 10:01 UTC
    Or if you're just interested in capturing the stuff, IPC::Run3