my $dbh = DBI->connect($data_source, $username, $password, \%attr) or die $DBI::errstr; ... my $sth = $dbh->prepare(...) or die $DBI::errstr;