in reply to Re: IPC::Run and start(); pump(); finish()
in thread IPC::Run and start(); pump(); finish()
I think I would be tempted to try modifying IPC::Run->signal() to return the result of kill:
sub signal { my IPC::Run $self = shift ; local $cur_self = $self ; $self->_kill_kill_kill_pussycat_kill unless @_ ; Carp::cluck "Ignoring extra parameters passed to kill()" if @_ > 1 +; my ( $signal ) = @_ ; my $rv; croak "Undefined signal passed to signal" unless defined $signal ; for ( grep $_->{PID} && ! defined $_->{RESULT}, @{$self->{KIDS}} ) +{ _debug "sending $signal to $_->{PID}" if _debugging; $rv = kill $signal, $_->{PID} or _debugging && _debug "$! sending $signal to $_->{PID}" ; } return $rv; }
and then use that within your pump loop with a parameter of 0;
pump $h while $h->signal( 0 ) and $out !~ /BRU Server >/i;
That ought to terminate the loop if the process could not be signalled (has died).
Obviously untested, but if it works, you could suggest the modification to the maintainer.
|
|---|