D
dkryzman
I am trying to check if notepad is running by doing kill(0,
$notepad_pid). While notepad is up and runnig the code returns 1 as
it should. Then, I close notepad manually, but kill(0, $notepad_pid)
still returns 1.
Here is my sample code:
$notepad_pid=$ARGV[0];
for($i=1;$i<100;$i++) {
$tst=kill(0,$notepad_pid);
print "kill => $tst\n";
sleep(1);
}
I close notepad when perl is in the for loop. Does anyone know the
solution to this problem?
$notepad_pid). While notepad is up and runnig the code returns 1 as
it should. Then, I close notepad manually, but kill(0, $notepad_pid)
still returns 1.
Here is my sample code:
$notepad_pid=$ARGV[0];
for($i=1;$i<100;$i++) {
$tst=kill(0,$notepad_pid);
print "kill => $tst\n";
sleep(1);
}
I close notepad when perl is in the for loop. Does anyone know the
solution to this problem?