From: Perl 5 Porters Date: Thu, 5 Sep 1996 04:14:21 +0000 (+0000) Subject: perl 5.003_05: lib/AnyDBM_File.pm X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ca4f5ef1241e5f772b3f0b4cadf4ff5dc4b2228d;p=p5sagit%2Fp5-mst-13.2.git 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. --- diff --git a/lib/AnyDBM_File.pm b/lib/AnyDBM_File.pm index c985e7e..e6a1503 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