in reply to RE: Re: why?
in thread why?
Forking works fine on ActivePerl 613 on NT, at least for me. The trouble is with the program flow. The first time through, you connect the parent's filehandles together. Fine. Then you fork off a child, let it keep the reader (and the parent the writer) and you send a message from parent to child. Child displays it, receives the EOF, and then exits. Perl closes the reader implicitly. The second time through, the parent uses pipe again, making another child. It then iterates through a hash of children, trying to send them messages.
Unfortunately, the other end of the pipe connected to the first child is gone. That'll cause some trouble.
Either close the writer at the end of the loop, or keep your children alive.
|
|---|