libdb-file-lock-perl | wrapper adding locking for the DB_File module | Mehr ...
When you need locking, simply use DB_File::Lock in place of DB_File and add an extra argument onto the tie command specifying if the file should be locked for reading or writing.