home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


dbmopen

dbmopen %
hash
, 
dbname
, 
mode

Binds a DBM file ( dbname ) to a hash (% hash ). dbname is the name of the database without the .dir or .pag extension. If the database does not exist, and a valid mode is specified, the database is created with the permissions specified by mode (as modified by the umask). To prevent creation of the database if it doesn't exist, you may specify a mode of undef , and the function will return a false value if it can't find an existing database. If your system supports only the older DBM functions, you may have only one dbmopen in your program.

Values assigned to the hash prior to the dbmopen are not accessible. If you don't have write access to the DBM file, you can only read the hash variables, not set them.

This function is actually just a call to tie with the proper arguments, but is provided for backward compatibility with older versions of Perl.


Previous: Reference: dbmclose Perl in a Nutshell Next: Reference: defined
Reference: dbmclose Book Index Reference: defined

Library Navigation Links

Copyright © 2001 O'Reilly & Associates. All rights reserved.