#!/usr/bin/perl use v5.12.2; use warnings; use strict; use HTML::Template; my $t = HTML::Template->new( filename => q{my_template_list.html}, ); my @colours = qw{red orange yellow green blue indigo violet}; # build an array of hashes (AoH) my @colour_params; for my $colour (@colours){ push @colour_params, {colour => $colour}; } $t->param(colours => \@colour_params); my $output = $t->output; say $output;