4.4. How does DBI work?

DBI is a generic interface which acts as a "funnel" between the programmer and multiple databases.

DBI protects you from needing to know the minutiae of connecting to different databases by providing a consistent interface for the programmer. The only thing you need to vary is the connection string, to indicate what sort of database you wish to connect to.

To use DBI, you need to install the DBI module from CPAN, as well as any DBD modules for the databases you use. For instance, to use MySQL you need to install the DBD::Mysql module.

Advanced: To install DBI, download the DBI module from CPAN, unzip it using a command like tar -xzvf DBI.tar.gz, then follow the instructions in the README file distributed with the module.