Think about Loose Coupling | |
PerlMonks |
Re: Make a perl script self aware...by snax (Hermit) |
on Aug 01, 2003 at 18:06 UTC ( [id://280073]=note: print w/replies, xml ) | Need Help?? |
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
|
|