in reply to How do you wait for a process to end ?

I think that you need to set up a signal handler for your children exiting -

$SIG{CHLD} = \&some_subroutine;
which will allow you to deal with the children as they die.

Replies are listed 'Best First'.
Re (tilly) 2: How do you wait for a process to end ?
by tilly (Archbishop) on Aug 24, 2001 at 07:49 UTC
    Perl does not have reliable signal handling. If it is for production use and has to work day in, day out for an extended time, I would suggest avoiding signal handlers.
      Interesting... I have never heard that, nor had that problem. Is it that way on all *nixes, or just on OSes with weird/broken signals?
        The problem is with Perl itself.

        IIRC there are two problems. The first is that if you receive a signal from within a signal handler, you are likely to dump core. The second is that if Perl allocates memory within a signal handler (which it might do for a lot of reaons), you are likely to dump core. The result is that if you are using signal handlers, doing complex things in your handlers, and receiving a large number of signals, you are aperiodically going to dump core.

        But note that I have heard rumor that Perl 5.8 is likely to fix this. (The problem with learning about the bugs is that they keep on going away...grumble...:-)