Debian Codegraph @

upstream/mageia-cauldron/man3pm/AnyDBM_File.3pm

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man v6.0.2 (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 .\" Required to disable full justification in groff 1.23.0.
57 .if n .ds AD l
58 .\" ========================================================================
59 .\"
60 .IX Title "AnyDBM_File 3pm"
61 .TH AnyDBM_File 3pm 2023-12-22 "perl v5.42.0" "Perl Programmers Reference Guide"
62 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
63 .\" way too many mistakes in technical documents.
64 .if n .ad l
65 .nh
66 .SH NAME
67 AnyDBM_File \- provide framework for multiple DBMs
68 .PP
69 NDBM_File, DB_File, GDBM_File, SDBM_File, ODBM_File \- various DBM implementations
70 .SH SYNOPSIS
71 .IX Header "SYNOPSIS"
72 .Vb 1
73 \& use AnyDBM_File;
74 .Ve
75 .SH DESCRIPTION
76 .IX Header "DESCRIPTION"
77 This module is a "pure virtual base class"\-\-it has nothing of its own.
78 It\*(Aqs just there to inherit from one of the various DBM packages. It
79 prefers ndbm for compatibility reasons with Perl 4, then Berkeley DB (See
80 DB_File), GDBM, SDBM (which is always there\-\-it comes with Perl), and
81 finally ODBM. This way old programs that used to use NDBM via \fBdbmopen()\fR
82 can still do so, but new ones can reorder \f(CW@ISA:\fR
83 .PP
84 .Vb 2
85 \& BEGIN { @AnyDBM_File::ISA = qw(DB_File GDBM_File NDBM_File) }
86 \& use AnyDBM_File;
87 .Ve
88 .PP
89 Having multiple DBM implementations makes it trivial to copy database formats:
90 .PP
91 .Vb 4
92 \& use Fcntl; use NDBM_File; use DB_File;
93 \& tie %newhash, \*(AqDB_File\*(Aq, $new_filename, O_CREAT|O_RDWR;
94 \& tie %oldhash, \*(AqNDBM_File\*(Aq, $old_filename, 1, 0;
95 \& %newhash = %oldhash;
96 .Ve
97 .SS "DBM Comparisons"
98 .IX Subsection "DBM Comparisons"
99 Here\*(Aqs a partial table of features the different packages offer:
100 .PP
101 .Vb 10
102 \& odbm ndbm sdbm gdbm bsd\-db
103 \& \-\-\-\- \-\-\-\- \-\-\-\- \-\-\-\- \-\-\-\-\-\-
104 \& Linkage comes w/ perl yes yes yes yes yes
105 \& Src comes w/ perl no no yes no no
106 \& Comes w/ many unix os yes yes[0] no no no
107 \& Builds ok on !unix ? ? yes yes ?
108 \& Code Size ? ? small big big
109 \& Database Size ? ? small big? ok[1]
110 \& Speed ? ? slow ok fast
111 \& FTPable no no yes yes yes
112 \& Easy to build N/A N/A yes yes ok[2]
113 \& Size limits 1k 4k 1k[3] none none
114 \& Byte\-order independent no no no no yes
115 \& Licensing restrictions ? ? no yes no
116 .Ve
117 .IP [0] 4
118 .IX Item "[0]"
119 on mixed universe machines, may be in the bsd compat library,
120 which is often shunned.
121 .IP [1] 4
122 .IX Item "[1]"
123 Can be trimmed if you compile for one access method.
124 .IP [2] 4
125 .IX Item "[2]"
126 See DB_File.
127 Requires symbolic links.
128 .IP [3] 4
129 .IX Item "[3]"
130 By default, but can be redefined.
131 .SH "SEE ALSO"
132 .IX Header "SEE ALSO"
133 \&\fBdbm\fR\|(3), \fBndbm\fR\|(3), \fBDB_File\fR\|(3), perldbmfilter