Chapter 4. Objects, Databases, and Applications
Perl programming is all about getting some data into our program, munging it around in various ways, and then spitting it back out again. So far we’ve looked at some interesting ways to do the munging and some great ways to represent the data, but our understanding of storing and loading data hasn’t reached the same kind of level.
In this chapter, we’re going to look at four major techniques for storing and retrieving complex data, and finally at application frameworks—technologies that pull together the whole process of retrieving, modifying, and acting on data, particularly for web applications, so that all the programmer needs to deal with is the business logic specific to the application.
For each technique, there are many CPAN modules that implement it in many different ways. We only have the space to examine one module in each section to demonstrate its approach; this is not necessarily an endorsement of the module in question as the best available. After all, there’s more than one way to do it.
Beyond Flat Files
The word database might conjure up thoughts of the DBI and big expensive servers running expensive software packages,[*] but a database is really just anything you can get data in to and back out of.
Just a step up from the comma-separated text file is the humble DBM database. This exists as a C library in several incarnations—the most well known being the Sleepycat Berkeley DB , available from http://www.sleepycat.com/download.html ...