kill(0,$pid) return 1 after application is killed manually

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top