A quick glance shows WAY too much HTML mixed in with perl -- even some XML! Sucking some of that content out via the templating package du jour would be an improvement. Besides, the file is 3000+ lines long, perhaps some refactoring is in order? =D
However - it works!