in reply to perl db_file

Your script appear to have no locking at all. That will lead to lost data. Try using MLDBM::Sync to wrap DB_File for you.