【发布时间】:2016-10-21 16:33:42
【问题描述】:
我是 perl 新手,我需要使用 DBI 连接数据库。我的代码如下:
use LWP::Simple;
use XML::Simple qw(:strict);
use Data::Dumper;
use DBI;
use Getopt::Long;
use IO::Uncompress::Gunzip qw(gunzip $GunzipError);
use IO::File;
use warnings;
$dbh = DBI->connect("dbi:);
if (!$dbh) {
&logMsg(0, "$DBI::errstr");
die;
} else {&logMsg(0,"Connection to $dbName DB OK")}
我已经设置了值。有点像连接失败,但我没有收到任何错误。我还检查了日志文件,没有任何显示。我可以做些什么来检查错误?感谢任何 cmets 和帮助。
【问题讨论】:
-
开启tracing。此外,启用
RaiseError,这样您就不必在每次通话后手动检查错误。并且总是use strict;! -
嗨@ThisSuitIsBlackNot,我用严格检查,仍然没有错误显示。