in reply to Re: Forking Problem
in thread Forking Problem

Thanks for the insight. However, I am a little stumped with your answer. Would all the children be pushing to the same pipe? (I was trying to keep everything seperate, ie seperate log file for each ssh I kick off). Thanks

Replies are listed 'Best First'.
Re^3: Forking Problem
by JavaFan (Canon) on Aug 28, 2008 at 16:38 UTC
    No, each time you do
    my $pid = open(my $child, "-|") // die "Fork failed: $!";
    you fork, and get a different pipe (there will be a pipe for each child).

    You might want to look in the "Safe Pipe Opens" section of the perlipc manual page for example code, and a description on how to open a pipe between a parent and a child.