Ok, time to dive into the code. First off, we have to specify the fields being used in this database. Just a note, only text and textarea are supported for the type of field. After this is out of the way, several global variables must be declared. Preferably I would use a full path, but this is your option, as you are making this database application.
Flock is the function perl uses to execute file locking.
File locking prevents your files from being corrupted and messed up if many invocations of this script occur at once. Now its time to do some work to gather the data on the fields specified. The reason for this is so that we can access the field information later on, quickly and easily. The first line of the foreach statement is rather important. This line makes sure everything you made appears as you made it.