in reply to using a 'here' doc to build a web page
What framework are you using? Mojolicious::Lite has a nice templating system by default (see this tutorial), other templating systems are optional, and a logical path for growth.
In Section
Seekers of Perl Wisdom