当我尝试建立与数据库的连接时,它会失败。但它也不会返回任何错误消息。
代码如下
my $dbh;
$dbh = DBI->connect('DBI:SQLAnywhere:', $connString, undef, {PrintError => 0, PrintWarn => 0})or die "died",$DBI::errstr,"\n";
#dbh = DBI->connect('DBI:SQLAnywhere:', $connString);
# setting up the authentication signature for the connection
print "$dbh";
if($dbh)
{
if(DbAuth::AuthenticateConnection($dbh))
{
return($dbh,$DbAuth::errstr) if (wantarray());
}
}
if (wantarray())
{
# The caller is prepared to deal with errors, so pass back the
# error string. It should only be used when the db_handle is 0.
return ($dbh, $DBI::errstr);
}
else
{
return $dbh;
}
知道为什么会这样,我该如何调试这个问题?
注意:我将perl从5.8升级到5.24