{
    "mode": "perldoc",
    "parameter": "AnyDBM_File",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/AnyDBM_File/json",
    "generated": "2026-06-16T10:24:53Z",
    "synopsis": "use AnyDBMFile;",
    "sections": {
        "NAME": {
            "content": "AnyDBMFile - provide framework for multiple DBMs\n\nNDBMFile, DBFile, GDBMFile, SDBMFile, ODBMFile - various DBM implementations\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use AnyDBMFile;\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This module is a \"pure virtual base class\"--it has nothing of its own. It's just there to\ninherit from one of the various DBM packages. It prefers ndbm for compatibility reasons with\nPerl 4, then Berkeley DB (See DBFile), GDBM, SDBM (which is always there--it comes with Perl),\nand finally ODBM. This way old programs that used to use NDBM via dbmopen() can still do so, but\nnew ones can reorder @ISA:\n\nBEGIN { @AnyDBMFile::ISA = qw(DBFile GDBMFile NDBMFile) }\nuse AnyDBMFile;\n\nHaving multiple DBM implementations makes it trivial to copy database formats:\n\nuse Fcntl; use NDBMFile; use DBFile;\ntie %newhash,  'DBFile', $newfilename, OCREAT|ORDWR;\ntie %oldhash,  'NDBMFile', $oldfilename, 1, 0;\n%newhash = %oldhash;\n\nDBM Comparisons\nHere's a partial table of features the different packages offer:\n\nodbm    ndbm    sdbm    gdbm    bsd-db\n----    ----    ----    ----    ------\nLinkage comes w/ perl   yes     yes     yes     yes     yes\nSrc comes w/ perl       no      no      yes     no      no\nComes w/ many unix os   yes     yes[0]  no      no      no\nBuilds ok on !unix      ?       ?       yes     yes     ?\nCode Size               ?       ?       small   big     big\nDatabase Size           ?       ?       small   big?    ok[1]\nSpeed                   ?       ?       slow    ok      fast\nFTPable                 no      no      yes     yes     yes\nEasy to build          N/A     N/A      yes     yes     ok[2]\nSize limits             1k      4k      1k[3]   none    none\nByte-order independent  no      no      no      no      yes\nLicensing restrictions  ?       ?       no      yes     no\n\n[0] on mixed universe machines, may be in the bsd compat library, which is often shunned.\n\n[1] Can be trimmed if you compile for one access method.\n\n[2] See DBFile. Requires symbolic links.\n\n[3] By default, but can be redefined.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "",
            "subsections": [
                {
                    "name": "dbm",
                    "content": ""
                }
            ]
        }
    },
    "summary": "AnyDBMFile - provide framework for multiple DBMs  NDBMFile, DBFile, GDBMFile, SDBMFile, ODBMFile - various DBM implementations",
    "flags": [],
    "examples": [],
    "see_also": []
}