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

Discussion in 'Perl' started by dkryzman@hotmail.com, Nov 5, 2003.

  1. Guest

    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?
     
    , Nov 5, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    3
    Views:
    1,662
  2. Rafael Chemtob

    session not being killed after user closes browser

    Rafael Chemtob, Feb 11, 2004, in forum: ASP General
    Replies:
    4
    Views:
    371
    Vilmar Braz√£o de Oliveira
    Feb 12, 2004
  3. Uwe Kubosch
    Replies:
    5
    Views:
    223
    Gary Wright
    Feb 2, 2008
  4. sanjayayogi
    Replies:
    3
    Views:
    135
    Martin DeMello
    Apr 4, 2009
  5. it_says_BALLS_on_your forehead

    if kill 9, $pid fails, is the error caught anywhere?

    it_says_BALLS_on_your forehead, Aug 1, 2007, in forum: Perl Misc
    Replies:
    15
    Views:
    187
    -berlin.de
    Aug 9, 2007
Loading...

Share This Page