in reply to File locking

One point to remember is that Perl only implements advisory file locking. That means that if you use flock but some other Perl script doesn't, then that other Perl script will be able to access the file on which you used flock.

The Camel book makes this distinction at length. Flock is like a red light at a traffic interection. If you and another driver both obey red lights, then only one of you can be in the center of the intersection at once. But if that other driver doesn't obey red lights then he can try and use the intersection at the same time as you, and a collision results.