Я делал не так.
В главной проге я ДБИ не подгружал, а делал это в своих модулях так:
package mod::dialup;
use strict;
use vars qw(@ISA @EXPORT $dbh);
use mod::common;
use Exporter;
use DBI;
@ISA = (\'Exporter\');
@EXPORT = qw();
sub get_inv {
 my $class = shift;
 my $self = {};
 %$self = @_;
 open(OLDERR,">&STDERR") or die "Couldn\'t dup STDERR: $!\\n";
 close(STDERR);
 eval \'$dbh = DBI->connect("DBI:mysql:$self->{dbname}:$self->{dbhost}",$self->{dbuser},$self->{dbpass});\';
 open(STDERR,">&OLDERR") or die "Couldn\'t dup OLDERR: $!\\n";
 close(OLDERR);
 open(STDERR,">>./error_log") or die "Couldn\'t rediect STDERR!: $!\\n";
 unless(defined $dbh){error("Database is not aviable",1);}
 $self->{rest_days} = {};
 $self->{holidays} = {};
 $self->{users} = {};
 $self->{users_id} = {};
 my $sth = $dbh->prepare(\'select * from settings;\');
 $sth->execute() or error("Can\'t execute the query \'select * from settings;\'");
 my $row;
 while($row = $sth->fetchrow_arrayref()){
  unless(exists $self->{$row->
   $self->{$row->
  }
 }
 $sth->finish();
 bless($self,$class);
 return $self;
}
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
sub finish {
 if(defined $dbh){$dbh->disconnect();}
}
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
При этом в главной программе делал вот что:
$dialup = mod::dialup->get_inv(%settings);
END {
 mod::dialup->finish();
}
Теперь с любого места в модуле можно просто, спокойно написать:
my $sth = $dbh->prepare(...