in reply to Re: Order of flock and open
in thread Order of flock and open
use LockFile::Simple qw(lock trylock unlock); $lockmgr = LockFile::Simple->make(-format => '%f.lck', -max => 20, -delay => 1, -stale => 1); # first program to get the lock the file gets the chance to run it + if($lockmgr->trylock("$eventsLogFile")){ my @bytes= split(//, $serial_data); $lockmgr->unlock("$eventsLogFile"); }
|
|---|