package HighLander; use strict; use Fcntl qw( LOCK_EX LOCK_NB ); open(our $fh, '<', $0) or die("Can't open \"$0\": $!\n"); unless ( flock($fh, LOCK_EX|LOCK_NB )) { print "Another instance of \"$0\" is already running. Exiting...\n"; exit(0); } 1;