[an error occurred while processing this directive]

Perl

Menu

Homework 7

In this assignment, you will use Perl/Tk to create a larger GUI application.

Create a Perl/Tk application to function as a book library. When first run, your program will display all current books in the system, along with the book's author, publisher, year of publication, and how many times you've read it. It will also have the following options:

  • Add a new book. Provide a form for the user to enter the new book's title, author, publisher, and year of publication. Add this book to your library, with a read count of 0.
  • Search for a book. Provide a form for the user to enter search criteria, including each of the five fields mentioned above. Allow the user to select whether to search for books that match all or any of those fields. Show the matching books.
  • Delete book(s). Provide a means for the user to select one or more books to be deleted, and remove them from the list.
  • Read book. Provide a means of increasing a book's read count by one.

After completing any of these operations, your script should again show the (possibly updated) main list of books, with all five fields. Your main list must also have the ability to be sorted, by whichever of the five fields the user choose.

Structural Requirements

You must have only ONE executable .pl script. You may write whatever modules you wish. If you do write modules, please make sure you use the h2xs procedure we used for HW4, and that you name your modules with the Rcsid::ModuleName convention we followed for that assignment as well. Regardless of how many modules you use, all of your executable code must be contained in one single .pl file.

Grading Criteria

Show all books 10
Add new book 15
Delete books 15
Search for book 15
Sort books 15
Read book 10
Application Navigation 5
No Warnings 5
Code Style 5
Error Checking 5

No Warnings

Your code should produce no Perl-generated warnings. Your program can and should produce warnings when the user does something wrong (adding a book without a title, for example).

Error Checking

As alluded to above, you must make sure the user doesn't do anything wrong. Make sure all fields are filled in, that the user doesn't try to delete without selecting a book to delete, that at least one criteria for search is entered, etc. If the user does do something wrong, handle it gracefully. Print out an appropriate error message, and either allow the user to retry the operation, or return to the main book listing. Under no circumstances should your program crash due to a stupid user.

Code Style

Your code must be well styled, including meaningful variable names, consistent indentation, and explanatory comments.

Application Navigation

In lieu of an "Output Style" criterion, you must make your application easy to navigate. The user should be able to quickly understand how to access each of the functionalities of your application. Forms and fields should be labeled, tables should be human readable, buttons should have meaningful names, etc. Under no circumstances should the User be forced to exit and restart the application.

Penalties

As with all homeworks, failure to compile is a 50pt reduction.

Unlike previous assignments, there will be NO late allowance. Homeworks not turned in by the due date will be graded a 0.

Submission Instructions

To submit, run ~lallip/public/submit.pl on solaris.remote.cs.rpi.edu, or use this submission form. Please include a README file describing the environment on which you tested your script. It should include the machine and operating system you used, the Perl version (`perl -v`) and the Perl/Tk version (`perl -MTk -le'print $Tk::VERSION'`)

You may submit infinte times, only the last submission will be graded. Your final submission is due 11:59:59pm EDT, Tuesday May 11, 2010

Perl Quotes
Perl Quotes