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*
In reply to Re: Never lock $0 inside of a BEGIN block
by particle
in thread Never lock $0 inside of a BEGIN block
by demerphq
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |