8.5. Project: MySQL, DBI, and mod_perl

We now have enough information to put all the ideas we have discussed into practice by combining mod_perl, MySQL, and DBI.

We start by developing a mod_perl program that displays to the visitor a list of available books about interesting computer subjects. Each book in the list will have a link taking the user to a page describing the details about the book, including the publisher and the price.

The collection will number approximately 75 books. With a database of such a small number of books, a possible solution would be to use a flat file to store the data, such as can be found in the file /var/www/misc/book_data.txt. A line of the file is a tab-delimited record containing the following:

  • ISBN

  • Author

Get Open Source Web Development with LAMP: Using Linux, Apache, MySQL, Perl, and PHP 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.