summaryrefslogtreecommitdiff
path: root/lib/AnyDBM_File.pm
diff options
context:
space:
mode:
authorPerl 5 Porters <perl5-porters@africa.nicoh.com>1996-09-05 04:14:21 +0000
committerAndy Dougherty <doughera@lafcol.lafayette.edu>1996-09-05 04:14:21 +0000
commitca4f5ef1241e5f772b3f0b4cadf4ff5dc4b2228d (patch)
tree0c55d9a75c79e8b485a9da8bf712a8bf42618952 /lib/AnyDBM_File.pm
parent0ecb046b660bd887053f3af294f8ec6411a8cbbc (diff)
downloadperl-ca4f5ef1241e5f772b3f0b4cadf4ff5dc4b2228d.tar.gz
perl 5.003_05: lib/AnyDBM_File.pm
AnyDBM_File (modifying ISA does not work as expected) Now behaves as documented: Modifying ISA works to select order in which *DB* modules are tried. The default is still the same. Add helpful "die" message to end of AnyDBM_File. Previously it would return a 0, and the failure would eventually show up somewhere else in the script and be hard to track down. It is a failure if perl can't open AnyDBM_File. The test regression suite is supposed to indicate this as a failure too.
Diffstat (limited to 'lib/AnyDBM_File.pm')
-rw-r--r--lib/AnyDBM_File.pm13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/AnyDBM_File.pm b/lib/AnyDBM_File.pm
index c985e7ed25..e6a15033c3 100644
--- a/lib/AnyDBM_File.pm
+++ b/lib/AnyDBM_File.pm
@@ -1,12 +1,15 @@
package AnyDBM_File;
+use vars qw(@ISA);
@ISA = qw(NDBM_File DB_File GDBM_File SDBM_File ODBM_File) unless @ISA;
-eval { require NDBM_File } ||
-eval { require DB_File } ||
-eval { require GDBM_File } ||
-eval { require SDBM_File } ||
-eval { require ODBM_File };
+my $mod;
+for $mod (@ISA) {
+ return 1 if eval "require $mod"
+}
+
+die "No DBM package was successfully found or installed";
+#return 0;
=head1 NAME