In doing some research, I discovered this Randal Schwartz article on using file locking in Perl CGI programs. I’m ashamed to admit that many of the old programs I’ve written don’t use file locking, even though they should. These days, I try to store everything in a relational database so I don’t have to mess with nasty plain text files.