24.5. La API Perl de MySQL

MySQL 5.0

24.5. La API Perl de MySQL

The Perl module provides a generic interface for database access. You can write a DBI script that works with many different database engines without change. To use DBI, you must install the module, as well as a DataBase Driver (DBD) module for each type of server you want to access. For MySQL, this driver is the module.

Perl DBI is the recommended Perl interface. It replaces an older interface called , which should be considered obsolete.

Installation instructions for Perl DBI support are given in Sección 2.13, “Notas sobre la instalación de Perl”.

DBI information is available at the command line, online, or in printed form:

  • Once you have the and modules installed, you can get information about them at the command line with the command:

    shell> perldoc DBI
    shell> perldoc DBI::FAQ
    shell> perldoc DBD::mysql
    

    You can also use , , and so forth to translate this information into other formats.

  • For online information about Perl DBI, visit the DBI Web site, http://dbi.perl.org/. That site hosts a general DBI mailing list. MySQL AB hosts a list specifically about ; see Sección 1.6.1.1, “Las listas de correo de MySQL”.

  • For printed information, the official DBI book is Programming the Perl DBI (Alligator Descartes and Tim Bunce, O'Reilly & Associates, 2000). Information about the book is available at the DBI Web site, http://dbi.perl.org/.

    For information that focuses specifically on using DBI with MySQL, see MySQL and Perl for the Web (Paul DuBois, New Riders, 2001). This book's Web site is http://www.kitebird.com/mysql-perl/.