Chapter 6. MySQL and Perl

The first several chapters of this book have covered both MySQL and Perl, showing you how both are very powerful and easy-to-use tools: one a powerful, open-source database that you can use as your backend data store, the other a flexible, rapid-development, great-at-parsing text, and even an object-oriented programming language. This chapter shows how both can be used together.

Ever since the advent of MySQL, Perl has been a natural choice for many programmers to work with MySQL. With so much data to process within a database, having an easy programming language to build applications that access and modify that data makes for a potent combination—one that has resulted in the development of many great applications, particularly web applications that major sites run.

This chapter gives you an overview of the Perl module, Database Independent Interface (DBI) and the API calls it provides, as well as how to start writing applications with MySQL in Perl. It will primarily focus on MySQL and Perl alone. The web applications that use both will be discussed in later chapters.

In addition, this chapter explains DBI, which is a standard set of database calls that work on a variety of databases. It also discusses the lower-level driver, DBD::mysql (DBD stands for database driver), which is MySQL-specific. This chapter gives an overview of various DBI methods, attributes, API method descriptions as well as some examples, and gives you a good start on how to write programs ...

Get Developing Web Applications with Perl, memcached, MySQL® and Apache now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.