MSYS: Update sed to a version that can handle filter-branch examples
[msysgit.git] / lib / perl5 / 5.8.8 / AnyDBM_File.pm
blobd73abab0f9e1c87e0359c907b8fea93d71514aed
1 package AnyDBM_File;
3 use 5.006_001;
4 our $VERSION = '1.00';
5 our @ISA = qw(NDBM_File DB_File GDBM_File SDBM_File ODBM_File) unless @ISA;
7 my $mod;
8 for $mod (@ISA) {
9 if (eval "require $mod") {
10 @ISA = ($mod); # if we leave @ISA alone, warnings abound
11 return 1;
15 die "No DBM package was successfully found or installed";
16 #return 0;
18 =head1 NAME
20 AnyDBM_File - provide framework for multiple DBMs
22 NDBM_File, DB_File, GDBM_File, SDBM_File, ODBM_File - various DBM implementations
24 =head1 SYNOPSIS
26 use AnyDBM_File;
28 =head1 DESCRIPTION
30 This module is a "pure virtual base class"--it has nothing of its own.
31 It's just there to inherit from one of the various DBM packages. It
32 prefers ndbm for compatibility reasons with Perl 4, then Berkeley DB (See
33 L<DB_File>), GDBM, SDBM (which is always there--it comes with Perl), and
34 finally ODBM. This way old programs that used to use NDBM via dbmopen()
35 can still do so, but new ones can reorder @ISA:
37 BEGIN { @AnyDBM_File::ISA = qw(DB_File GDBM_File NDBM_File) }
38 use AnyDBM_File;
40 Having multiple DBM implementations makes it trivial to copy database formats:
42 use POSIX; use NDBM_File; use DB_File;
43 tie %newhash, 'DB_File', $new_filename, O_CREAT|O_RDWR;
44 tie %oldhash, 'NDBM_File', $old_filename, 1, 0;
45 %newhash = %oldhash;
47 =head2 DBM Comparisons
49 Here's a partial table of features the different packages offer:
51 odbm ndbm sdbm gdbm bsd-db
52 ---- ---- ---- ---- ------
53 Linkage comes w/ perl yes yes yes yes yes
54 Src comes w/ perl no no yes no no
55 Comes w/ many unix os yes yes[0] no no no
56 Builds ok on !unix ? ? yes yes ?
57 Code Size ? ? small big big
58 Database Size ? ? small big? ok[1]
59 Speed ? ? slow ok fast
60 FTPable no no yes yes yes
61 Easy to build N/A N/A yes yes ok[2]
62 Size limits 1k 4k 1k[3] none none
63 Byte-order independent no no no no yes
64 Licensing restrictions ? ? no yes no
67 =over 4
69 =item [0]
71 on mixed universe machines, may be in the bsd compat library,
72 which is often shunned.
74 =item [1]
76 Can be trimmed if you compile for one access method.
78 =item [2]
80 See L<DB_File>.
81 Requires symbolic links.
83 =item [3]
85 By default, but can be redefined.
87 =back
89 =head1 SEE ALSO
91 dbm(3), ndbm(3), DB_File(3), L<perldbmfilter>
93 =cut