Text Files as Databases

Often, databases are small, simple arrangements: a list of users on a small system, local hosts on a small network, a list of favorite Web sites, or a personal address file. These are all simple forms of databases, and for simple databases, normal text files will often do. But before using text files as databases, you need to consider some pros and cons.

The good news: Using a text file as a database has a few distinct advantages over using more complicated alternatives such as DBM files or large databases such as Oracle or Sybase. Some of these advantages are:

  • Text file databases are portable. They can be moved between vastly different kinds of systems without too much trouble.

  • Text file databases can be edited with a ...

Get SAMS Teach Yourself Perl in 24 Hours THIRD EDITION now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.