Maybe use a real template instead, like HTML::Template?
In reply to Re: Loading HTML template using Perl and CGI by moritz in thread Loading HTML template using Perl and CGI by ZimCS