In-Class Assignment #9
This assignment will introduce you to using HTML::Template
to create a CGI application
You will write a small CGI application to serve as a text file editor.
When the application is first accessed, it will display a list of all filenames
and their sizes in your temp/ directory (you can just hardcode that directory name).
The files will be in a select box that the user can choose from.
When the user pushes the submit button, your script will display the contents of the file in a textarea. When the user pushes the submit button that page, whatever contents are in the textarea will be written to the actual file. The application will then redisplay the first page (the file chooser).
To aid you in this task, I have created two HTML::Template
files. Copy the following files to your cgi-bin directory:
-
/cs/lallip/perl/ic9_choosefile.tpl- Displayed when there are no parameters, or when the user has saved the file contents via the second page. -
/cs/lallip/perl/ic9_editfile.tpl- Displayed when the user has pushed the first page's submit button.
Make sure you view these two template files to see the names of all parameters that need to be filled in.
You may not modify either of the template files, and all of your Perl code must be contained in one single .cgi file
Submission Instructions
To submit, log in to solaris.remote.cs.rpi.edu and run
/cs/lallip/public/submit.pl and follow the prompts. Your submission
is due at 6pm today, Wednesday, April 16, 2008.
