Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Checking for multiple instances

by dragonchild (Archbishop)
on Sep 24, 2004 at 17:06 UTC ( [id://393594]=note: print w/replies, xml ) Need Help??


in reply to Checking for multiple instances

Try having the script check for a running instance of itself as its first task. 'ps' is your friend here. I'm sure there's a CPAN that will do this for you.

Otherwise, what's wrong with using something like Cache::File? First thing you do is check the cache to see if the lock is set. If it is, leave. If it's not, set the lock. When you're done, release the lock.

------
We are the carpenters and bricklayers of the Information Age.

Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose

I shouldn't have to say this, but any code, unless otherwise stated, is untested

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2024-04-19 21:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found