in reply to Make a perl script self aware...
Thanks for all your help, you are the monks that make this a great community.# Needed for "Only allow one process of this script"-rule use Fcntl ':flock'; INIT { open LH, $0 or die "Can't open $0 for locking!\nError: $!\n"; # lock file so that it can only be accessed # by the current running script # DIE is mute (doesn't print to the screen) on Windows flock LH, LOCK_EX|LOCK_NB or die "$0 is already running somewhere!\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Make a perl script self aware... all platforms
by monkeyperl (Initiate) on Jun 25, 2008 at 00:51 UTC |