3 AnyDBM_File - provide framework for multiple DBMs
5 NDBM_File, ODBM_File, SDBM_File, GDBM_File - various DBM implementations
13 This module is a "pure virtual base class"--it has nothing of its own.
14 It's just there to inherit from one of the various DBM packages. It
15 prefers ndbm for compatibility reasons with Perl 4, then Berkeley DB (See
16 L<DB_File>), GDBM, SDBM (which is always there--it comes with Perl), and
17 finally ODBM. This way old programs that used to use NDBM via dbmopen()
18 can still do so, but new ones can reorder @ISA:
20 @AnyDBM_File::ISA = qw(DB_File GDBM_File NDBM_File);
22 Note, however, that an explicit use overrides the specified order:
25 @AnyDBM_File::ISA = qw(DB_File GDBM_File NDBM_File);
27 will only find GDBM_File.
29 Having multiple DBM implementations makes it trivial to copy database formats:
31 use POSIX; use NDBM_File; use DB_File;
32 tie %newhash, DB_File, $new_filename, O_CREAT|O_RDWR;
33 tie %oldhash, NDBM_File, $old_filename, 1, 0;
36 =head2 DBM Comparisons
38 Here's a partial table of features the different packages offer:
40 odbm ndbm sdbm gdbm bsd-db
41 ---- ---- ---- ---- ------
42 Linkage comes w/ perl yes yes yes yes yes
43 Src comes w/ perl no no yes no no
44 Comes w/ many unix os yes yes[0] no no no
45 Builds ok on !unix ? ? yes yes ?
46 Code Size ? ? small big big
47 Database Size ? ? small big? ok[1]
48 Speed ? ? slow ok fast
49 FTPable no no yes yes yes
50 Easy to build N/A N/A yes yes ok[2]
51 Size limits 1k 4k 1k[3] none none
52 Byte-order independent no no no no yes
53 Licensing restrictions ? ? no yes no
60 on mixed universe machines, may be in the bsd compat library,
61 which is often shunned.
65 Can be trimmed if you compile for one access method.
70 Requires symbolic links.
74 By default, but can be redefined.
80 dbm(3), ndbm(3), DB_File(3)