Assigned: Week One
Due: Week Two
It is common in DBMS-less database-style applications to store information in a flat file, with one record per line. The different fields in a record are then separated by some character, such as a comma or a colon (you may recall Greenspun's rant about CSV). In this homework, you'll work with such files in a number of ways. Feel free to come up with your own variations. You should plan to get through A and B and some additional work. I expect that not all of yhou will get through C.
You should treat this like any other large programming project: For parts B and C Think about how you break the problem up into smaller parts, and then figure out the Perl for solving those smaller parts. (You may also choose a more bottom-up design if you'd like.)
A. Design a simple flat file for some application of your choice. You might list books, CDs, golf clubs, whatever. Fill in at least ten lines of data.
B. Write a Perl script that takes command line parameters for (1) a database file in the format from A and (2) patterns that select data items. Your script should output all matching lines in HTML format. For example,
% selectcd samscds -artist "Van Morrision" % selectcd samscds -title ".*dance.*"
C. Generalize your script so that the flat file can contain the names of columns on the first row.
[Current]
[Glance]
[Honesty]
[Instructions]
[Links]
[News]
[Search]
[Syllabus]
Primary
[Examples]
[Exams]
[Handouts]
[Homework]
[Labs]
[Outlines]
[Quizzes]
[Readings]
[Reference]
Sets
[Login]
[Drop Box]
[Discussions]
[Grades]
Blackboard
[SamR]
Links
Disclaimer: I usually create these pages on the fly. This means that they are rarely proofread and may contain bad grammar and incorrect details. It also means that I may update them regularly (see the history for more details). Feel free to contact me with any suggestions for changes.
This page was generated by Siteweaver on Tue Jan 23 09:52:33 2001.
This page may be found at http://www.cs.grinnell.edu/~rebelsky/Courses/CS397/2001S/hw.01.html.
You may validate
this page's HTML.
The source was last modified Tue Jan 23 09:41:51 2001.