What is the best way to create a lock on a file in Perl?
Is it best to flock on the file or to create a lock file to place a lock on and check for a lock on the lock
Flock is probably the best but requires you to write all the supporting code around it - timeouts, stale locks, non-existant files etc. I trued LockFile::Simple but found it started setting the default umask to readonly and not cleaning this up. Resulting in random permissions problems on a multi process/multi-threaded application on modperl I've settled on wrapping up NFSLock with some empty file handling.