Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Perl cannot see mysql module

Status
Not open for further replies.

dooley28

Programmer
Jan 3, 2008
23
IE
Hi all,

I'm having an issue connecting perl to mysql.
I was coding perl a while back and left it for a bit. Now that I've come back the code won't work as it doesn't see mysql.

When I use
use Mysql;
Which I used before, it see's it as an immediate error in my syntax.

I noticed that mysql.pm was located in these areas.
/usr/lib/perl5/Bundle/DBD/mysql.pm
/usr/lib/perl5/DBD/mysql.pm

So I tried
use DBD::mysql;
Which gave me no syntax errors.
Again no luck, this time a compilation error
Useless use of a variable in void context at script.pl line 48.
Name "Mysql::db_errstr" used only once: possible typo at KeywordDetection.pl line 38.
Content-type: text/html

Can't locate object method "connect" via package "Mysql" at script.pl line 31.

I'm using ubuntu Gutsy Gibbon if that helps.
Thanks in advance for any help.

 
The Mysql module is considered obsolete. You should be using the DBI module and the mysql drivers.

OBSOLETE SOFTWARE ^

As of Msql-Mysql-modules 1.19_10 M(y)sqlPerl is no longer a separate module. Instead it is emulated using the DBI drivers. You are strongly encouraged to implement new code with DBI directly. See "COMPATIBILITY NOTES" below.

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
The good thing is if you go to the standard DBI module you can change between other DB's pretty easily :D

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[noevil]
Travis - Those who say it cannot be done are usually interrupted by someone else doing it; Give the wrong symptoms, get the wrong solutions;
 
Is this path part of your @INC? If not have you tried the use lib to load the module?
 
Thanks for your help everyone.
I gave up an just replaced the calls with DBI.

Yeah I saw how easy it was to change the calls to different db type. That's a nice touch.

:D
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top