Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: Kill a perl script execution in windows

by BrowserUk (Pope)
on Feb 18, 2013 at 13:44 UTC ( #1019342=note: print w/ replies, xml ) Need Help??


in reply to Re: Kill a perl script execution in windows
in thread Kill a perl script execution in windows

That's good for preventing a second copy from starting; but not so useful for killing the previous version if it is running because it doesn't give you the pid.


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.


Comment on Re^2: Kill a perl script execution in windows
Re^3: Kill a perl script execution in windows
by nikosv (Hermit) on Feb 18, 2013 at 16:06 UTC
    you don't need the PID. The first script waits for a signal to terminate as:
    use Win32::Event; use 5.010; $event = Win32::Event->new(1,0,"myevent"); while ($event->wait(0)==0) { say $i; print $i++; } say "exiting";
    or just $event->wait(), depends on the situation.Then the second one can signal it to abort :
    use Win32::Event; use 5.010; $event = Win32::Event->new(1,0,"myevent"); say $^E; $event->set;

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (16)
As of 2014-10-20 13:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (77 votes), past polls