Re: Close a Running Sub-Process



# start
use strict;
use warnings;

my $fh = undef;
# there is a '|' at the end
my $child_process = "ssh username@host tail --follow=name
file_to_be_tailed |";
open $fh, $child_process || Carp::confess("can't open $child_process:
$!");
while (<$fh>) {
chomp;
if (/successful/) {
last;
}
}
close $fh;
# end

.



Relevant Pages