#!perl -w use strict; $|=1; use Win32::Mutex; my $mutexname="PIGMania"; if(Win32::Mutex->open($mutexname)){ print "must be already running"; exit; } my $mutex=Win32::Mutex->new(1,$mutexname); $mutex->wait(3); print "Mutex: $mutex\n"; my $x=30; while($x){ print "."; select(undef,undef,undef,1.5); $x--; } #### #!perl -w use strict; $|=1; use Win32::Semaphore; my $semaphore_name="PIGMania"; if(Win32::Semaphore->open($semaphore_name)){ print "$semaphore_name is already running\n"; exit; } my $semaphore=Win32::Semaphore->new(1,1,$semaphore_name); print "Semaphore: $semaphore\n"; my $x=30; while($x){ print "."; select(undef,undef,undef,1.5); $x--; }