Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: Kill a process in perl windows and proceed only if it killed the process

by Anonymous Monk
on Jul 24, 2012 at 15:50 UTC ( #983447=note: print w/ replies, xml ) Need Help??


in reply to Re: Kill a process in perl windows and proceed only if it killed the process
in thread Kill a process in perl windows and proceed only if it killed the process

I tried the killProcess call followed by wait() call that BrowserUK suggested, but when I tried Win32::Process::Wait it gives me this error message- 'Usage:Win32::Process::Wait(cP, timeout)'
what is 'cP' argument means?

$^E=0; Win32::Process::KillProcess($pid, 111) or warn $^E; Win32::Process::Wait(INFINITE);
Thanks,
Peter


Comment on Re^2: Kill a process in perl windows and proceed only if it killed the process
Download Code
Re^3: Kill a process in perl windows and proceed only if it killed the process
by BrowserUk (Pope) on Jul 24, 2012 at 15:56 UTC
    what is 'cP' argument means?

    You are calling Win32::Process::Wait() as a subroutine; you should be calling it as a method.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

    The start of some sanity?

      sorry, I didn't understand.
      I get the processids of the applications running on a processing node and I just want to kill it and wait for that process to be killed. I am not creating the process using Win32::Process::Create().
        I am not creating the process using Win32::Process::Create().

        Then you will need to obtain a handle to the process using:

        my $proc = Win32::Process::Open( $pid, $iflags ); Creates a handle Perl can use to an existing process as identified by +$pid.

        And then call the Wait method on that handle:

        $proc->Wait( <milliseconds|INFINITE> );

        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.

        The start of some sanity?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://983447]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (14)
As of 2014-12-26 17:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (174 votes), past polls