Just to add to
Zaxo's above comment,
flock() eq 'good' ...
People new to CGI programming often miss the fact that the http server will start multiple copies of your process, and any data files read/written could be done so at the same time. While reads are ok, all processes should be using
flock() so they do not read partial data, or write at the same time as another process.
Moral of the story : Pleas use
flock() for any CGI process which reads/writes data files.
"They shall not overcome. Whoever told them that the truth shall set them free was obviously and grossly unfamiliar with federal law."
-- John Ashcroft