in reply to Re^4: Waiting for an External Program to Finish Executing
in thread Waiting for an External Program to Finish Executing

Every fork in the code is preceded by unless. unless (fork evaluating to undef()) is the only way any of the six branches can be followed and the only other possibility (pid=0) can't happen - it appears from your response you have projected your own ideas of intent and have lost the actual flow in that respect.

-M

Free your mind

  • Comment on Re^5: Waiting for an External Program to Finish Executing

Replies are listed 'Best First'.
Re^6: Waiting for an External Program to Finish Executing
by sgifford (Prior) on Nov 15, 2005 at 17:16 UTC
    Why do you think that $pid == 0 "can't happen", when it's plainly documented that fork returns 0 in the child every single time it is executed? Have you actually called fork and observed its return values in parent and child to verify your assertion? If you don't think it returns 0 in the child, what do you think it returns, and how do you think the two processes know which is which?

    How do you think my sample code "(loses) the actual flow" when it's copied and pasted from the OP's, with minimal changes to have it output its flow?