#!/usr/bin/perl -w use strict; use HTML::Template; $|++; my @cities = ( { LABEL => "A", CITY => "Milwaukee" }, { LABEL => "B", CITY => "Milpitas" }, { LABEL => "C", CITY => "Millston" }, { LABEL => "D", CITY => "Milbrook" }, { LABEL => "E", CITY => "Millboro" } ); my $t = HTML::Template->new(filehandle => *DATA); $t->param(CITIES => \@cities); print $t->output; __END__ Content-Type: text/html
Label:
City:
##
Content-Type: text/html
Cities
Label: A
City: Milwaukee
Label: B
City: Milpitas
Label: C
City: Millston
Label: D
City: Milbrook
Label: E
City: Millboro