Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Never lock $0 inside of a BEGIN block

by particle (Vicar)
on May 21, 2003 at 19:46 UTC ( #259852=note: print w/ replies, xml ) Need Help??


in reply to Never lock $0 inside of a BEGIN block

i prefer to lock __DATA__, and i do it in an INIT block, like so:

## ensure only one instance is running INIT { flock DATA => LOCK_EX | LOCK_NB or exit 1 } ## ...script... __DATA__

i haven't run into a problem with this technique yet. (unless you call trying to save changes to the script while it's running a problem... ;)

~Particle *accelerates*


Comment on Re: Never lock $0 inside of a BEGIN block
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2014-12-27 08:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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





    Results (176 votes), past polls