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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I use Perl to interact with my database?

Perl Database Resources

How can I use Perl to interact with my database?

by  hmerrill  Posted    (Edited  )
Quoting from "Programming the Perl DBI" book by Alligator Descartes & Tim Bunce,

"The DBI is the standard interface for the Perl
programming language. The DBI is database-
independent, which means that it can work with just
about any database, such as Oracle, Sybase,
Informix, Access, MySQL, etc."

The main Perl DBI web page is:

http://dbi.perl.org

On that page you will find many great resources to get you going with DBI.
However, that page does not provide a way to download the DBI and related
DBD modules - for that see below.

For downloading,
* find the Perl Database Interfaces page at

http://search.cpan.org/modlist/Database_Interfaces

* the DBI module is on that same page - just click
on the "DBI" link - it will take you to the general
"DBI" page - this page has loads of excellent information.

Notice at the top of this page, the title looks like

Tim Bunce > DBI-1.30 > DBI

Click on the latest version(DBI-1.30) link to go to
the...latest DBI version page. On that page you will
be able to download the current version. That page
also lists links to other DBI modules and documenation.

* and find all the DBD(database specific) modules at

http://search.cpan.org/modlist/Database_Interfaces/DBD

You'll need at least the "DBI" module, and the "DBD" module corresponding to your particular database, to get started.

One of the great things that the Perl DBI does for you is gives you
portablility - you write your code to the DBI spec, and with very few
changes, you can change the database from MySQL to Oracle(or whatever),
and that same DBI code will still work. Of course that's assuming that
you keep your SQL along "standard" lines, and you don't take advantage
of the "non-standard" features that your database might offer.
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top