in reply to Perl and HTML

As said above, an SSI will do the trick. I would suggest taking a look at HTML::Template. I think it is good practice to separate your logic from your UI (HTML in this case). HTML::Template makes this very easy.