Programming in Perl

Homework 5

Frequently Asked Questions

  1. Can you clarify the * option for the filename? If someone enters "a*", do we return all files whose names contain an a followed by anything?
    No. If someone enters "a*", you return all files whose names contain literally "a*". The only thing special about the asterisk happens if someone enters EXACTLY "*". The lone asterisk simply means "all files", and you are then to return all files of the selected type(s).
  2. I ( don't know | can't remember | forgot | never knew ) my CS Account password. What do I do?
    Email labstaff@cs.rpi.edu and request a password reset.
  3. Can we create a static HTML page for the form?
    No. You must have one single CGI script that generates all output, including the form and the search results.
  4. Why am I getting HTTP 500 Internal Server Error when I click on the links my program generated?
    Most likely because you generated a link that goes to cgi2.cs.rpi.edu. cgi2.cs.rpi.edu attempts to execute any file located in cgi-bin/ (or its subdirectories), rather than simply display them. You need to instead generate absolute links to www.cs.rpi.edu.
  5. Is the extention part of the filename? ie, if the user searches for "mp", should all MP3 files be returned, since they end with .mp3?
    Yes, assuming the user also selects Audio as one of the file types to search for.
  6. After making the file user-executable, I'm still getting HTTP 500. When I run it on the command line by typing `perl file.cgi`, it seems to work fine. If I just type the file name, I get this message: "/usr/bin/env: No such file or directory". What's wrong?
    Two possibilities: either your shebang is wrong, or you saved the file in windows before transferring it to your CS account, and forgot to run dos2unix. At the command line, type `dos2unix file.cgi file.cgi`