The CGI::Carp module can be used to help CGI programs fail gracefully
The URI::Escape module can be used to encode and decode percent-encoded URLs
The Text::Template module can be used to easily fill in text templates, including HTML templates.
The Mail::Mailer module can be used to send email based on the information entered in an HTML form
All these modules can be downloaded from CPAN, the Comprehensive Perl Archive Network