in reply to using a 'here' doc to build a web page
as already said it will be valid for a small, not often changed project. But since Perl 5.26 at least you can indent your heredocs: see Indented_Here-documents in perldelta.
A template system is something good to have in your bag of tools: recently in an interesting, similar thread Text::Xslate was suggested as terribly fast compared to the classical Template::Toolkit see Best way to start a perl project
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.