# @cmd contains the traceping command to launch remotely via the existing SSH connexion. my $killed; my (undef, $f_stdout, $f_stderr, $pid) = $self->{ssh}->open3(@cmd); while (<$f_stdout>){ # OUTPUT ANALYZED AND PROCESSED HERE $killed = kill(15, $pid); last; } waitpid $pid, 0; close $f_stdout; close $f_stderr;