810:088 Perl/CGI Web Programming Assignment: Due date: Friday, July 20th Deliverables: Turn in a printout of the two .cgi files. One shows the FORM and allows the user to SUBMIT a request for a given calendar or series of months for any year. The other .cgi file, of course, is the ACTION= target file that gets executed when the user clicks the SUBMIT button. Email and write on your two .cgi files the URL to get to them. Be sure to put a comment line in each of your .cgi files with your name. i.e. # Written by Samuel Student Email to jacobson@uni.edu or jacobson@cns.uni.edu the URL. It uses the Unix cal command and the back tic technique to invoke a server command from within Perl: To learn more about the Unix cal command, type "man cal" at the chaos prompt. Press the Enter key to read the next line of manual pages, press the Spacebar key to jump to the next screenful of output. The reason it is "man cal" instead of "help cal" is that help is considered a manual, an online manual on Unix. --- Your Perl/CGI files will consist of two different Perl CGI scripts: 1. The first .cgi file will be used to display the web page with the form where the user can type in the list of months and the list of years they need to see: -------------------------------- Months | | Enter a comma separated -------------------------------- list of months, or leave blank. ------------------ Year | | Enter the Year value or leave blank ------------------ Submit button (Caption might say: Show calendar). 2. The 2nd .cgi file will be the ACTION of the FORM for the previous .cgi file. It will do the following: If the Year and the Months fields were blank, just display the output of Unix cal, which is the calendar for the current month of the current year. If the Year is filled in and the Months field is left blank, give the 12 month calendar for the year that was specified in the Year field of the FORM and received by param('year') CGI function. If the Year field is blank, but the Months field is filled in, give the calendar for each of those months in the current year. You will need to use the localtime(time) function to obtain the value for the current year. You DO NOT want to have to change your Perl script on 12/31/2001 so it works right in 2002! If the Year field is filled in and the Months field is filled in, give the calendar for each and everyone of the specified months for that year that was specified. For example: Month(s) 1, 3, 5, 7,11 Year 1988 Would cause the following to be output: January 1988 calendar March 1988 calendar May 1988 caledar July 1988 calendar November 1988 calendar ------------------------------------------------------------------------------ You are welcome to add additional features to this program. One additional feature that might be useful would be to have an additional textbox that allowed users to type month-year pairs: -------------------------------- Custom: | 1,1989,3,2000,5,2001,7,1776 | commas only -------------------------------- or -------------------------------- Custom: | 1,1989;3,2000;5,2001;7,1776 | commas and semicolons -------------------------------- If the textbox or text field named 'custom' were not empty, you perl/cgi script would have to separate out the month and year pairs, and then go through and output the calendars for each and every pair. January 1989 March 2000 May 2001 July 1776 would be the four calendars for the above. Another feature I just thought of would be to allow the user to use hyphens. Thus the month(s) textfield could have: ------------------------ Months: | 1,5-8,12 | ------------------------ instead of the user having to type 1,5,6,7,8,12 ------------ An interesting variation to the Months could be a hyphenated pair of numbers x-y where x is greater than y. ------------------------ Months: | 11-5 | ------------------------ ----------- Year: | 2000 | would mean November 2000 ----------- December 2000 January 2001 February 2001 March 2001 April 2001 May 2001 11-5 and 2000, in other words, means November 2000 through May 2001. The above optional features are NOT REQUIRED for this assignment.