my add.cgi will be like this, my $component=$query->param('component'); my $ccc_id=$query->param('ccc_id'); my %data = ( ccc_id => $ccc_id, component_name => $component, add => \@tc_add_templ ); my $template = Template->new({ }); $template->process($file,\%data) || die $template->error();