use strict; use warnings; use Win32::Mutex; # This returns a handle to the mutex, and optionally creates it my $mutex = Win32::Mutex->new(0, 'appln_mutex_name'); # Grab the lock, or block $mutex->wait; # This is for testing purposes # Insert some clever Perl stuff here print "Hit to continue"; ; # release the lock $mutex->release;