For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > August 2006 > Can't locate object method "require_version"









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Can't locate object method "require_version"
darkknight56

2006-08-27, 6:57 pm

I have the following perl code to connect to an mysql database.

use lib "D:\\Perl\\site\\lib\\PerlEx";

use DBI;
# database information
$db="test";
$userid="root";
$password="julie123";
$connectionInfo="DBI:mysql:database=$db;";

# make connection to database

$dbh=DBI->connect($connnectionInfo, $userid,$password);

$query="show tables";
$sth=$dbh->prepare($query);
$sth->execute();

$sth->finish();

$dbh->disconnect;

and I get the follow error. Any suggestions?
C:\Documents and Settings\Patrick>perl database_connection.pl
Can't locate object method "require_version" via package "DBI" at
D:\Perl\site\lib\PerlEx/DBI.pm line 22.
Compilation failed in require at database_connection.pl line 2.
BEGIN failed--compilation aborted at database_connection.pl line 2.

darkknight56

2006-08-27, 9:57 pm


darkknight56 wrote:
> I have the following perl code to connect to an mysql database.
>
> use lib "D:\\Perl\\site\\lib\\PerlEx";
>
> use DBI;
> # database information
> $db="test";
> $userid="root";
> $password="julie123";
> $connectionInfo="DBI:mysql:database=$db;";
>
> # make connection to database
>
> $dbh=DBI->connect($connnectionInfo, $userid,$password);
>
> $query="show tables";
> $sth=$dbh->prepare($query);
> $sth->execute();
>
> $sth->finish();
>
> $dbh->disconnect;
>
> and I get the follow error. Any suggestions?
> C:\Documents and Settings\Patrick>perl database_connection.pl
> Can't locate object method "require_version" via package "DBI" at
> D:\Perl\site\lib\PerlEx/DBI.pm line 22.
> Compilation failed in require at database_connection.pl line 2.
> BEGIN failed--compilation aborted at database_connection.pl line 2.


I should add that I am using Perl 5.8 from ActiveState

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com