if ($dbh = DBI->connect(...)) { ... #### my $dbh = DBI->connect(...., {RaiseError => 1});