#!/usr/bin/perl use warnings; use strict; use HTML::Template; use CGI qw/:standard/; print header(); my $template=HTML::Template->new(filehandle=>*DATA,die_on_bad_params=>1); my @count; foreach(1..10){ my %hash; $hash{NUMBER}=$_; push @count,\%hash; } $template->param( HEAD_TITLE=>'Test HTML::Template Page', PAGE_TITLE=>'This is a test HTML page.', CONTENT=>'Here is some sample content', COUNT=>\@count ); print $template->output; __DATA__ <!-- TMPL_VAR HEAD_TITLE ESCAPE=HTML -->

I can count!