package A; use DBI; @CARP_NOT = "DBI"; # doesn't work sub foo { my $dbh = DBI->connect(..., {RaiseError => 1}); my $sth = $dbh->prepare("asdf"); $sth->execute; # bang! }