in reply to open for append

Note that Win32 doesn't do the seek-then-write atomicly, so you should lock if your code might be/is run on Win32. Also note that if you didn't use binmode (which is likely true and usually for good reason), then the order of things is seek, then newline conversion, then write, which makes the race even racier.

As mentioned elsewhere, another problem is if the write is too large, which will cause it to be broken up into chunks and the chunks from different processes might be interleaved.

Another problem is if you do more than one write operation. If the total data to be written is small enough and you are on a POSIX system, then you can build up the entire string to be written and use a single write operation and (usually) not worry about locking. But sometimes it is more convenient to write the code using multiple write operations, in which case you'd want to lock so the data doesn't get interleaved.

- tye