module DBI问题请教????

module DBI问题请教????

#!/usr/bin/perl
use strict;
use DBI;

my $dbh = DBI->connect("dbi:mysql:discuz@localhost:3306", 'root','594833', '') or die "can't connect!\n";
my $sql = qq/show variables/;
my $sth = $dbh->prepare($sql);
$sth->execute();

while(my @array=$sth->fetchrow_array())
{
   printf("%-35s", $_) foreach(@array);
   print "\n";
}
$dbh -> disconnect();
exit 0;  


上面的脚本,运行以后出现如下错误:
Can't locate loadable object for module DBI in @INC (@INC contains: D:/Perl/lib
D:/Perl/site/lib .) at D:/Perl/site/lib/DBI.pm line 252
BEGIN failed--compilation aborted at D:/Perl/site/lib/DBI.pm line 252.
Compilation failed in require at test.pl line 3.
BEGIN failed--compilation aborted at test.pl line 3.

试过DBI-1.40 DBI-1.46和DBI-1.60  错误信息基本类似,还请牛人能够指点一二

试试 perldoc -l DBD::mysql 和 perl -MDBD::mysql -e 1 看会输出什么?


[Copy to clipboard] [ - ]
CODE:
D:\Perl\site\lib>perldoc -l DBD::mysql
D:\Perl\site\lib\DBD/mysql.pm

D:\Perl\site\lib>perl -MDBD::mysql -e 1
Can't locate loadable object for module DBI in @INC (@INC contains: D:/Perl/lib
D:/Perl/site/lib .) at D:/Perl/site/lib/DBI.pm line 252
BEGIN failed--compilation aborted at D:/Perl/site/lib/DBI.pm line 252.
Compilation failed in require at D:/Perl/site/lib/DBD/mysql.pm line 11.
Compilation failed in require.
BEGIN failed--compilation aborted.

D:\Perl\site\lib>sed -n '248,254p' DBI.pm
$EXPORT_TAGS{preparse_flags} = [ grep { /^DBIpp_\w\w_/ } keys %{__PACKAGE__."::"
} ];

Exporter::export_ok_tags(keys %EXPORT_TAGS);

}

*trace_msg = \&DBD::_::common::trace_msg;


D:\Perl\site\lib>sed -n '11p' DBD/mysql.pm
require DBI;

DBD和DBI都是直接从tar.gz包里解压出PM,直接复制到lib里,不知道这样会不会有问题
呵呵,这样当然不行啦。
perl Makefile.PL
nmake
nmake test
nmake install
呵呵。
上个星期我也刚装过DBI模块,多试几次就好了!