Index
Perl CGI Exercises
CGI.pm and MySQL
Please make sure that you have completed last weeks Perl tutorials before you even read the following or you will be wasting your time trying to do things that you have not yet been taught.
- Push the mail form with cookies mailform3.pl and maillist2.pl onto a web server.
Remember the easy way to get the source code?
Remember laziness? This is not a typing school.
- Modify the code to:
- write to a file in your filesystem
- use your own copy of MyTime.pm
What permissions do you need to give the mlist.txt file?
- Modify the code to include JavaScript validation of form data.
This should be easy if you have completed last weeks tutorial
- Modify the code to:
- correctly restore the checkbox settings from the cookie
- include a 'Clear Form' button that clears all settings
Note that the reset button should still restore the default settings.
This is less than trivial, try packing the checkbox settings into a single value in the hash that stores the cookie.
- Modify the code to also validate form data on the server.
Again this should be easy if you have completed last weeks tutorial.
- Push the mail form with database mailformdb.pl and maillistdb.pl onto a web server.
- Modify the code to attach to your database - trivial!
Of course you need to create the database first.
- Modify the code to include a 'Clear Form' button that clears all settings.
This again is less than easy.
Look at the HTML produced by CGI.pm and make sure that you understand how the code is working.
Read Lincoln Stein's CGI.pm documentation.
Study the way that the code behaves in different browsers.
Then approach the problem from a high level.
- Add code to the acknowlegement page to display all of the data currently in the database.
This could be a great deal of data.
How could it be displayed a page at a time?
Index