in reply to Do I need to lock log files?

For the answer from 08:53, "old" version of perl means anything earlier than 5.004. What a great excuse to upgrade! :) Also, in the above code, you should check the return values of flock and seek. Finally, unlocking is not necessary - the close will release the lock quite nicely.

Here's an interesting quote from the fopen manpage:

If two separate processes open the same file for append, each process may write freely to the file without fear of destroying output being written by the other. The output from the two processes will be intermixed in the file in the order in which it is written.
Depends on your OS, of course, but most should be safe, and do not necessarily need file locking (especially if each process is only writing a single line to the file!)