I thoroughly agree with jdtoronto. A Templating system is what you need.
Take a look at Template Toolkit (CPAN Template) as an alternative to HTML::Template. It provides an additional level of flexibility.
Whether you should have that level of flexibility in your view layer is a religious discussion better left elsewhere.