Homework 2

Due: Tuesday, October 16, 2001 11:59:59pm EDT

Please read the Homework 2 FAQ for clarifications as to the homework requirements. Also, see the Sample HTML file.

Your assignment is to write a program that will take in the absolute pathname to the home directory of an RCS user (ex: /home/36/lallip) from the command line, and print out a list of all HTML documents in that user's public_html directory.

Your program will take in the directory, get a listing of all files in that user's public_html directory, search for HTML documents (ie, documents with extentions of .html or .htm), and print out this list.

For each HTML file found, your program will do two things:
1) Print the name of the file, followed by a list of links within the document. The list of links should contain both the address of the link, as well as the text that is clicked on to activate that link.
2) Store a local copy of the HTML file in the directory from which your program was executed. This local copy will have the same name as the file you found in the remote directory, but will have one modification: All instances of "Rensselaer" or "Rensselaer University" must be replaced with the abbreviation "RPI". Note that the entire phrase "Rensselaer Polytechnic Institute" must NOT be replaced. Note further that upper- and lower-case letters should have no effect on these rules.

Grading Criteria

* As before, this must be a valid attempt at creating the entire program
** Your program should print out an appropriate error message any time the user does something wrong. It should never ever crash or hang, and should never simply ignore the wrong-ness of what the user did, without an explanation

As with the last assignment, a maximum of 5% "Above and Beyond" credit is available for significant contributions to the program beyond what is required above. This does NOT mean a more attractive interface, nor does it mean code that makes your program more efficient or more portable. I care about neither efficiency nor portability (as far as this class is concerned, anyway)

Obviously, this program MUST WORK on an RCS machine. Build/Test it wherever you wish, but it must work on the RCS system. If for some reason, you do not have an RCS account, please speak with me ASAP. (If you have an RCS account but prefer not to use it - time to start using it.)

Submission Guidelines

(please read carefully)

When you have finished, send one email to both lallip@cs.rpi.edu and mcguij2@cs.rpi.edu. The subject of your email should be "Perl Homework 2". The *body* of your email should contain four lines: Your email should contain ONE attachment: A plain-text file containing your program. The name of this file should be your RCS username, followed by whatever extention makes you happy. (In otherwords, a submission from me would be named lallip.pl, lallip.plx, lallip.perl, lallip.txt, lallip.cgi, lallip.SomeRallyBigExtention, or something similar) Do NOT attach a readme file. Do NOT attach a sample run-through script. Do NOT attach a description of what the program is supposed to do (I *know* what it's supposed to do - I wrote the assignment).

The homework is due Tuesday, 10/16, at 11:59:59pm EDT. Please take into account how much the network can slow-down when many people are trying to work and submit projects. Submitting 8 hours after the deadline with the plea "The network was too slow!" will not save you from the late penalty.
The homework will be accepted until Wednesday, 10/17, at 11:59:59pm EDT at a reduction of 20%.