use POSIX qw(:signal_h :errno_h :sys_wait_h); $SIG{CHLD} = \&Reaper; # diese zeile muss vor dem fork kommen sub Reaper { my $pid; $pid = waidpid(-1, &WNOHANG); if ($pid == -1) { # no child waiting => ignore it } elsif (WIFEXITED($?)) { print "Process $pid exited\n"; } else { print "False alarm on $pid\n"; } %SIG{CHLD} = \&Reaper; } # Reaper