Perl: Data Persistence
DBM files
This unit presents enough principles to access to Berkeley DB from Perl, using the DB_File module. The base work is done on top of DBM files, which are on-disk hash tables. And, being hash tables, you can look up values by key and update and delete values in place.
ODBMthe length of a key, plus the length of its associated value, may not exceed 1008 bytes.
SDBM,
NDBM
may have a default limit of 1024 bytes for the size of a record.
Fcntl constants
           O_RDONLY            Read only
           O_WRONLY            Write only
           O_RDWR              Read and write
           O_CREAT             Create the file if it doesn't exist
           O_EXCL              Fail if the file already exists
           O_APPEND            Append to the file
           O_TRUNC             Truncate the file
           O_NONBLOCK          Non-blocking access


goto [Course index] [Section index] [Previous] [Next]
Dr Jaime Prilusky, course@weizmann.ac.il.