Debian Codegraph @

upstream/debian-unstable/man3/AnyDBM_File.3perl

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45)
3 .\"
4 .\" Standard preamble:
5 .\" ========================================================================
6 .de Sp \" Vertical space (when we can't use .PP)
7 .if t .sp .5v
8 .if n .sp
9 ..
10 .de Vb \" Begin verbatim text
11 .ft CW
12 .nf
13 .ne \\$1
14 ..
15 .de Ve \" End verbatim text
16 .ft R
17 .fi
18 ..
19 .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
20 .ie n \{\
21 . ds C` ""
22 . ds C' ""
23 'br\}
24 .el\{\
25 . ds C`
26 . ds C'
27 'br\}
28 .\"
29 .\" Escape single quotes in literal strings from groff's Unicode transform.
30 .ie \n(.g .ds Aq \(aq
31 .el .ds Aq '
32 .\"
33 .\" If the F register is >0, we'll generate index entries on stderr for
34 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
35 .\" entries marked with X<> in POD. Of course, you'll have to process the
36 .\" output yourself in some meaningful fashion.
37 .\"
38 .\" Avoid warning from groff about undefined register 'F'.
39 .de IX
40 ..
41 .nr rF 0
42 .if \n(.g .if rF .nr rF 1
43 .if (\n(rF:(\n(.g==0)) \{\
44 . if \nF \{\
45 . de IX
46 . tm Index:\\$1\t\\n%\t"\\$2"
47 ..
48 . if !\nF==2 \{\
49 . nr % 0
50 . nr F 2
51 . \}
52 . \}
53 .\}
54 .rr rF
55 .\" ========================================================================
56 .\"
57 .IX Title "AnyDBM_File 3perl"
58 .TH AnyDBM_File 3perl 2025-11-16 "perl v5.40.1" "Perl Programmers Reference Guide"
59 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
60 .\" way too many mistakes in technical documents.
61 .if n .ad l
62 .nh
63 .SH NAME
64 AnyDBM_File \- provide framework for multiple DBMs
65 .PP
66 NDBM_File, DB_File, GDBM_File, SDBM_File, ODBM_File \- various DBM implementations
67 .SH SYNOPSIS
68 .IX Header "SYNOPSIS"
69 .Vb 1
70 \& use AnyDBM_File;
71 .Ve
72 .SH DESCRIPTION
73 .IX Header "DESCRIPTION"
74 This module is a "pure virtual base class"\-\-it has nothing of its own.
75 It's just there to inherit from one of the various DBM packages. It
76 prefers ndbm for compatibility reasons with Perl 4, then Berkeley DB (See
77 DB_File), GDBM, SDBM (which is always there\-\-it comes with Perl), and
78 finally ODBM. This way old programs that used to use NDBM via \fBdbmopen()\fR
79 can still do so, but new ones can reorder \f(CW@ISA:\fR
80 .PP
81 .Vb 2
82 \& BEGIN { @AnyDBM_File::ISA = qw(DB_File GDBM_File NDBM_File) }
83 \& use AnyDBM_File;
84 .Ve
85 .PP
86 Having multiple DBM implementations makes it trivial to copy database formats:
87 .PP
88 .Vb 4
89 \& use Fcntl; use NDBM_File; use DB_File;
90 \& tie %newhash, \*(AqDB_File\*(Aq, $new_filename, O_CREAT|O_RDWR;
91 \& tie %oldhash, \*(AqNDBM_File\*(Aq, $old_filename, 1, 0;
92 \& %newhash = %oldhash;
93 .Ve
94 .SS "DBM Comparisons"
95 .IX Subsection "DBM Comparisons"
96 Here's a partial table of features the different packages offer:
97 .PP
98 .Vb 10
99 \& odbm ndbm sdbm gdbm bsd\-db
100 \& \-\-\-\- \-\-\-\- \-\-\-\- \-\-\-\- \-\-\-\-\-\-
101 \& Linkage comes w/ perl yes yes yes yes yes
102 \& Src comes w/ perl no no yes no no
103 \& Comes w/ many unix os yes yes[0] no no no
104 \& Builds ok on !unix ? ? yes yes ?
105 \& Code Size ? ? small big big
106 \& Database Size ? ? small big? ok[1]
107 \& Speed ? ? slow ok fast
108 \& FTPable no no yes yes yes
109 \& Easy to build N/A N/A yes yes ok[2]
110 \& Size limits 1k 4k 1k[3] none none
111 \& Byte\-order independent no no no no yes
112 \& Licensing restrictions ? ? no yes no
113 .Ve
114 .IP [0] 4
115 .IX Item "[0]"
116 on mixed universe machines, may be in the bsd compat library,
117 which is often shunned.
118 .IP [1] 4
119 .IX Item "[1]"
120 Can be trimmed if you compile for one access method.
121 .IP [2] 4
122 .IX Item "[2]"
123 See DB_File.
124 Requires symbolic links.
125 .IP [3] 4
126 .IX Item "[3]"
127 By default, but can be redefined.
128 .SH "SEE ALSO"
129 .IX Header "SEE ALSO"
130 \&\fBdbm\fR\|(3), \fBndbm\fR\|(3), \fBDB_File\fR\|(3), perldbmfilter