#!/usr/bin/perl use strict; use CGI::Carp qw(fatalsToBrowser); use CGI ':standard'; use HTML::Template; print "Content-type:text/html\n\n"; my $path = '/path/'; my $formspace = $path . 'formspace.tt'; my $file_contents; open FH, '<', $formspace or die "Can't open $formspace: $!"; $file_contents = do { local $/; }; close FH; my $template = HTML::Template->new(filename => $path . 'index.tt'); $template->param(FORMSPACE => $file_contents); print $template->output;