From: Rob Kinyon Date: Sun, 3 Jan 2010 17:59:06 +0000 (-0500) Subject: Fixed immediate dependence on DBI X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=addbe56afe6573701c8f56e4933c93bfef7018b7;p=dbsrgits%2FDBM-Deep.git Fixed immediate dependence on DBI --- diff --git a/lib/DBM/Deep.pm b/lib/DBM/Deep.pm index 20efded..ff2585d 100644 --- a/lib/DBM/Deep.pm +++ b/lib/DBM/Deep.pm @@ -9,15 +9,14 @@ our $VERSION = q(1.0019_002); use Scalar::Util (); -use DBM::Deep::Engine::DBI (); -use DBM::Deep::Engine::File (); - use overload '""' => sub { overload::StrVal( $_[0] ) }, fallback => 1; use constant DEBUG => 0; +use DBM::Deep::Engine; + sub TYPE_HASH () { DBM::Deep::Engine->SIG_HASH } sub TYPE_ARRAY () { DBM::Deep::Engine->SIG_ARRAY } @@ -89,6 +88,7 @@ sub _init { ? 'DBM::Deep::Engine::DBI' : 'DBM::Deep::Engine::File'; + eval "use $class"; die $@ if $@; $args->{engine} = $class->new({ %{$args}, obj => $self, diff --git a/t/common.pm b/t/common.pm index 2e67111..53d9e29 100644 --- a/t/common.pm +++ b/t/common.pm @@ -43,8 +43,8 @@ sub new_dbm { if ( $ENV{TEST_SQLITE} ) { (undef, my $filename) = new_fh(); # $filename = 'test.db'; -#warn "$filename\n"; push @reset_funcs, sub { + require 'DBI.pm'; my $dbh = DBI->connect( "dbi:SQLite:dbname=$filename", '', '', );