AnyDBM_File

Provides a single Database Manager (DBM) interface regardless of the DBM implementation you use. The module inherits from the various DBM packages; by default, it inherits from NDBM_File. If it doesn’t find NDBM_File, the default search order is: DB_File, GDBM_File, SDBM_File (which comes with Perl), and finally, ODBM_File. You can override this default order by redefining @ISA:

@AnyDBM_File::ISA = qw(DB_File GDBM_File NDBM_File);

However, an explicit use takes priority over the @ISA ordering.

Perl’s dbmopen function simply calls tie to bind a hash to AnyDBM_File. The effect is to bind the hash to one of the specific DBM classes that AnyDBM_File inherits from.

Get Perl in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.