# 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"; }