NDBM_File, ODBM_File, SDBM_File, GDBM_File - various DBM implementations
use AnyDBM_File;
dbmopen
can still do so, but new ones can reorder
@ISA:
@AnyDBM_File::ISA = qw(DB_File GDBM_File NDBM_File);
Note, however, that an explicit use overrides the specified order:
use GDBM_File; @AnyDBM_File::ISA = qw(DB_File GDBM_File NDBM_File);
will only find GDBM_File.
Having multiple DBM implementations makes it trivial to copy database formats:
use POSIX; use NDBM_File; use DB_File; tie %newhash, 'DB_File', $new_filename, O_CREAT|O_RDWR; tie %oldhash, 'NDBM_File', $old_filename, 1, 0; %newhash = %oldhash;
odbm ndbm sdbm gdbm bsd-db ---- ---- ---- ---- ------ Linkage comes w/ perl yes yes yes yes yes Src comes w/ perl no no yes no no Comes w/ many unix os yes yes[0] no no no Builds ok on !unix ? ? yes yes ? Code Size ? ? small big big Database Size ? ? small big? ok[1] Speed ? ? slow ok fast FTPable no no yes yes yes Easy to build N/A N/A yes yes ok[2] Size limits 1k 4k 1k[3] none none Byte-order independent no no no no yes Licensing restrictions ? ? no yes no
dbm,
ndbm,
DB_File