http://qs321.pair.com?node_id=11135087


in reply to singleton lock not reliable

Many thanks to all who took the time to respond. Key seems to be using a writable lock file. The following version has been running over a month with no dups so I'll call it good.
# only one of us my $LOCKFN = "/tmp/x.mylock"; open my $LF, '>', $LOCKFN or die "Can not create $LOCKFN: $!"; flock ($LF, LOCK_EX | LOCK_NB) or exit;