June 2005
Beginner
480 pages
10h 31m
English
One of the simplest ways for your Perl program to remember data in an organized way is through the use of DBM files. A DBM file is a file that's been connected to a Perl hash. To read and write a DBM file, you simply manipulate a hash, just as you've been doing since Hour 7, “Hashes.”
To tie your hash to a DBM file, use the Perl function dbmopen, as shown here:
dbmopen(hash, filename, mode)
The dbmopen function connects the hash to a DBM file. The filename you supply actually creates one or two different files on your hard disk with names that are a variation on filename: filename.pag, filename.dir, or filename.db. Perl uses these files to store the hash. These files are not text files, and you should not attempt to use an editor ...
Read now
Unlock full access