Coding in Perl

March 24, 2009 at 18:12:32
Specs: Windows XP
I am writing a script in Perl where I want to get data from 2 colums in the database.

What is the code to retrieve the data from the database?


See More: Coding in Perl

Report •


#1
March 24, 2009 at 18:51:43
what database you are using? normally it will come with command line client, that allows you to query the database with SQL language. check your documentation.

Report •

#2
March 24, 2009 at 20:26:05
When using Perl, you almost never shell out to use a cli. Perl has lots of database modules.

DBI - Database independent interface for Perl
http://search.cpan.org/~timb/DBI-1....

You also need a driver module that is specific to you database, such as:

DBD::mysql - MySQL driver for the Perl5 Database Interface (DBI)
http://search.cpan.org/~capttofu/DB...

Other DBD:: modules
http://search.cpan.org/search?query...


Report •

Related Solutions


Ask Question