in reply to How to use Storable in CGI scripts

Check out Apache::Session. You can use a flat file (or a database if you prefer) and it will take care of the file locking details for you.