in reply to Loading HTML template using Perl and CGI

$query->start_html prints some HTML already. So if your existing HTML code contains <html><head>... already, this is no option. Likewise for $query->end_html.

Maybe use a real template instead, like HTML::Template?