|
dear sir,
i wrote a simple db.pl do some jobs with database.
it works through "$perl db.pl". compiling it with perlcc, execute "$./db".
the error is:
Undefined subroutine &DBI::dr::connect called
at /usr/lib/perl5/site_perl/5.6.0/i386-linux/DBI.pm line
471. what could be the problem?
i saw the same error in the maillist, but no one
answer it.
db.pl as below:
#! /usr/bin/perl -w use
strict; use DBI; use DBD::mysql; my
$dbusername = 'test'; my $dbpassword = 'test'; my $sql; my
$dbh; my $dbname = 'test';
$dbh = DBI->connect('DBI:mysql:'.$dbname,
$dbusername, $dbpassword) || die "$DBI::errstr\n"; $sql =
$dbh->prepare("INSERT INTO testac VALUES (11,
'youknow')"); $sql->execute; $dbh->disconnect();
thanks a lot.
xu, yilin |