All together now ... --#-- Putting this all together gives us a general-purpose Perl script capable of handling all the input elements in a typical HTML form.

For example purposes, I've included one monolithic script that contains code handlers for each type of element. Of course, if no such element exists in the form, that particular code won't do much.

This script merely redisplays it's originating form with any available data filled in. Figuring out how to notify the user that an error occurred, or what to do with this new form, is your job ;-).

Complete script here.