|
|
|
Your skill will accomplish what the force of many cannot |
|
| PerlMonks |
Re: Make a perl script self aware...by snax (Hermit) |
| on Aug 01, 2003 at 14:06 UTC ( [id://280073]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
I suggest you read perlipc carefully -- there's a bunch of ways for processes to talk to one another. Make the script do *something* in order to listen, and make it's first job try to talk to where it "will be listening", and exit if it gets an "I'm already running" response. No such response means the new script should *start* listening, so that the next invocation can be told to bugger off :) There's a small race condition but I imagine that's hard to get around.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||