http://qs321.pair.com?node_id=714856


in reply to What the flock!? Concurrency issues in file writing.

I just have to ask, because it hasn't been mentioned... You are not writing to an NFS filesystem, right?

You could use a semaphore instead of flock (IPC::SysV::Semaphore).

Of course, writing lots of data from multiple sources for ultimate sorting sounds like a DB application to me. SQLite or MySQL might seem to be overkill, but they are really easy to install and interface with. If you are storing these reports over time, this is a much better archive system as well. Finally, if your retrieval needs increase in the future, your options are wide open.