Rather than convert all your HTML to CGI.pm, you may want to look at using the
Template Toolkit (my favourite) or
HTML::Template (also very popular) for the display portion of your script. This'll keep the processing and the presentation separate, and make your script much easier to write and maintain.
Good luck!
_______________
DamnDirtyApe
Those who know that they are profound strive for clarity. Those who
would like to seem profound to the crowd strive for obscurity.
--Friedrich Nietzsche