You might search around on perldoc.org, but I found this in the perlfaq4...
http://language.perl.com/newdocs/pod/perlfaq4.html#Why_don_t_my_E_lt_E_lt_HE
RE_docu
As far as template systems go you should look into HTML::Template and
HTML::Mason on CPAN.
http://search.cpan.org/search?module=HTML::Te
i was given the following advice concerning a large amount of html being
used within a script:
It would be cleaner to use document templates instead of
embedding the page in your code. If you put it in your code,
it'd be clearer to use shell-style HERE documents than so many
multiline print state