Perl's flock is only able to do exclusive locking on files opened for write if your system lacks both a native flock and a native fcntl. There is an excellent chance that a *nix like OS has flock.
BUT BEWARE! On some operating systems you may have flock but it won't always work (eg Linux fails on NFS mounted partitions). The presence of this failure condition is non-obvious, and furthermore failure to lock tends to be missed in light testing, even though it is often critical in production. For that reason it is extremely important to always test whether flock succeeded and handle errors sanely (eg through a die).
In reply to Re (tilly) 2: Locking files
by tilly
in thread Locking files
by Ras
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |