use warnings; use strict; use IPC::Shareable; tie my $lock, 'IPC::Shareable', { key => 'LOCK', create => 1, exclusive => 1, destroy => 1, graceful => 1 }; $lock = $$; print "procID: $lock\n"; sleep 5; #### spek@scelia ~/scratch $ perl lock.pl procID: 21241 #### spek@scelia ~/repos/ipc-shareable $ perl ~/scratch/lock.pl spek@scelia ~/repos/ipc-shareable $ #### spek@scelia ~/repos/ipc-shareable $ perl ~/scratch/lock.pl procID: 21339