Length: 3 hours
Prerequisites: Basic familiarity with Perl is required.
New 20071107: Now available online for free!
Many programs need cheap, convenient access to small amounts of data. There are two commonly used solutions: Flat text files and DBM files. This class will look at these in detail. Whether you're looking for a good solution for storage of your own data, or you have to deal with data stored in one of these formats by another program, this class will equip you with valuable tools for solving your problems.
In the first section, we'll look at techniques for managing flat text databases and the systems programming that underlies these. We'll examine the tradeoffs of variable vs. fixed-length records and sorted vs. unsorted files. In the second section, we'll take a detailed look at Tie::File, a new standard module that provides easy access to text databases.
The third section will be an overview of Perl's 'DBM' feature, including a comparison of the standard DBM modules. We'll see several extremely useful but little-known features of DB_File, the only one of these standard modules that doesn't have serious defects.
This
work is
licensed under a
Creative
Commons Attribution-Noncommercial-Share Alike 3.0 License.
This
work is
licensed under a
Creative
Commons Attribution-Noncommercial-Share Alike 3.0 License.
Example source code from Lightweight Databases
class is licensed under a
Creative
Commons Public Domain License.
Return to: Universe of Discourse main page | Perl Paraphernalia | Other Classes and Talks
mjd-perl-yak+@plover.com