#!/usr/bin/env perl use v5.16.3; use strict; use warnings; use autodie; use Data::Dump qw(dump); use HTML::Template; my $template = HTML::Template->new(filename => 'test.tmpl'); open FILE, ">", "output.html"; $template->param(RECORDS => [ {LINENUMBER => "1", CHARACTER => "Sid", TEXT => "this only prints the first word"}, {LINENUMBER => "2", CHARACTER => "Sid", TEXT => "this only prints the first word"}, {LINENUMBER => "3", CHARACTER => "Sid", TEXT => "this only prints the first word"}, ]); print FILE "Content-Type: text/html\n\n", $template->output; close FILE;