# This is a trick used to prevent concurrent applications # from running, but that will work WITHOUT needing pid # or lock files, and so is kill -9 or power failure safe. # To work it needs a __DATA__ section to be defined at # the end of the file. use Fcntl 'LOCK_EX', 'LOCK_NB'; unless ( flock DATA, LOCK_EX | LOCK_NB ) { # An existing instance of this application is already running print STDERR "Program is already running\n"; exit(0); } __DATA__ Used as a lock to prevent concurrent execution. Do not remove this data section.
In reply to Re^3: Windows process
by adamk
in thread Windows process
by qadwjoh
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |