Note that depending on your OS and how you call the program, a second open may fail (and then, the flock isn't necessary).use Fcntl ':flock'; open my $fh, "+<", $0 or exit; exit unless flock $0, LOCK_EX | LOCK_NB;
In reply to Re: Easiest way to protect process from duplication.
by JavaFan
in thread [Solved]Easiest way to protect process from duplication.
by kazak
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |