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

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?