I am trying to initiate the execution of monitor.pl by using this following pipe mechanism:
$cpid = open($fh, '-|', "./monitor.pl >/dev/null") or die "can not open pipe\n";
The output of monitor.pl is redirected to /dev/null.
The problem which I am facing is that I am not able to kill the processes even after using the following code:
kill ('INT', $cpid) if defined $cpid;
close $fh if defined $fh;
So please can anyone suggest me how to kill the process monitor.pl >/dev/null.