#!/usr/bin/perl use warnings; use CGI::Carp qw(fatalsToBrowser); use HTML::Template; use strict; use CGI; my $query = new CGI; my $t = $query->param('type'); my @option; $option[1] = $query->param('option1'); $option[2] = $query->param('option2'); $option[3] = $query->param('option3'); $option[4] = $query->param('option4'); my $template = HTML::Template->new(filename => '../htmltemplatetests.tmpl', associate => $query,die_on_bad_params => 0); { no strict 'subs'; $template->param( type.$t => "1", option.$_ => $option[$_]) for (1 .. 7); } print "Content-type: text/html\n\n"; print $template->output(); exit();