http://www.perlmonks.org?node_id=65936

senor_fjord has asked for the wisdom of the Perl Monks concerning the following question:

I have a program that forks and runs another executable. In the meanwhile, the main program runs some diagnostics, and should terminate when the child does. How can I do this?

Originally posted as a Categorized Question.

  • Comment on Can I get notified of a child process terminating?

Replies are listed 'Best First'.
Re: Can I get notified of a child process terminating?
by archon (Monk) on Mar 21, 2001 at 05:36 UTC
Re: Can I get notified of a child process terminating?
by mslattery (Initiate) on Apr 19, 2002 at 18:40 UTC
    And of course the way you would do this is by...

    sub catch { my $signal_name = shift ; die "Caught CHLD" ; # or whatever you wish to do! } $SIG{CHLD} = \&catch;

    See http://perldoc.perl.org/ and search on PERLIPC

    Good Luck!,
    mslattery