in reply to Processes clobbering each other

One problem I see is that the parent process is reading from all of the child processes through the "first_child" file handle. This makes it easy for output from the children to be mixed together. This is especially true since pipes are block buffered and will tend to split lines. One thing to try is unbuffering the output in the children processes. Then they will write for each line. This may not work if

Also, why are you using the piped open for the second call? You never write to the stdin of the subprocesses. And there is no point to having a child process that just waits for the system to return. A fork/exec would work just as well.

Replies are listed 'Best First'.
Re: Re: Processes clobbering each other
by mcogan1966 (Monk) on Nov 25, 2003 at 15:46 UTC
    In the above respoce from holo, that is exactly what I'm doing now. As for unbuffering, I thought that's what I was doing when I had the line $| = 1;. Am I wrong here?