Home: Perl Programming Help: DBI:
run sql queries with perl



aueddonline
Novice

Sep 3, 2011, 1:08 PM


Views: 15604
run sql queries with perl

I am getting the following error after using 'use Mysql ' in my perl code


Can't locate Mysql.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at ./sqlquery line 3

do I need to download a package or something? Sorry if this is an easy question, just started using perl.


FishMonger
Veteran / Moderator

Sep 3, 2011, 3:04 PM


Views: 15600
Re: [aueddonline] run sql queries with perl

Yes, you need to install the module.

However, the Mysql module is depreciated. It's better to use the DBI module along with DBD::mysql.

http://search.cpan.org/~timb/DBI-1.616/DBI.pm
http://search.cpan.org/~capttofu/DBD-mysql-4.020/lib/DBD/mysql.pm


aueddonline
Novice

Sep 3, 2011, 4:56 PM


Views: 15595
Re: [FishMonger] run sql queries with perl

Hey I got it working!

Thanks for the links and explanation