in reply to Re: Re: A flock()alypse now
in thread A flock()alypse now

This approach causes data loss if:

If you don't want to risk losing data, use the sentinel locking approach already mentioned by others in this thread.

However, if the weaknesses of using only a read/write filehandle aren't a problem for you, you might want to look into FileHandle::Rollback.