in reply to Forking children operate sequentially?!

You wait for output from the youngest child before launching another, and the child presumably sends it's output when it's done.

By the way, PARENT_WTR is poorly named since the parent doesn't write to it. I prefer TO_CHLD and FR_CHLD.

Replies are listed 'Best First'.
Re^2: Forking children operate sequentially?!
by darwinscusp (Initiate) on Mar 11, 2010 at 19:49 UTC

    Thanks ikegami.

    Is it possible to *not* wait for the child to return output, yet still capture it?

    Yeah, those names suck. I copied it from some other code, I think it originated from the cookbook.

      Is it possible to *not* wait for the child to return output, yet still capture it?

      Well, what you want to do is move the waiting to the outside of the loop, and wait for all the children "at once" (via polling, select, or whatever). Below is a solution using Thread::Queue.