Hour 15. Finding Permanence

 <  Day Day Up  >  

Hour 15. Finding Permanence

What You'll Learn in This Hour:

  • Create a DBM file and store data in it

  • Treat regular text files as a database

  • Read and write to random positions in files

  • Lock files for concurrent access

Writing Perl programs that find data in files or interact with the user is all well and good. But what happens when the program ends? The results are gone, you've got nothing to show for your effort, and you're left with this empty feeling ”as though nothing had happened at all.

You may already be thinking of ways in which you could solve this problem in Perl based on what you have learned in previous hours, such as files, lists, and hashes. That would, of course, be the Hard Way.

Storing information for later retrieval the Easy Way is what databases are all about. A database is a set of one or more files in a particular format that specialized software can access for storing data and retrieving it later. A properly designed database can be used by many kinds of programs for queries, reports , and data entry. To design a database, you need to think carefully about what kind of data you want to store and how you want to store it. You also need to consider how the data will be accessed: by one person at a time or by many users simultaneously .

 <  Day Day Up  >  


SAMS Teach Yourself Perl in 24 Hours
Sams Teach Yourself Perl in 24 Hours (3rd Edition)
ISBN: 0672327937
EAN: 2147483647
Year: 2005
Pages: 241

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net