#!/usr/bin/perl
use strict;
use warnings;
use HTML::Template;

my $tmpl = qq(
    LOOP 2
    <tmpl_loop stuffs>
      Stuff      => <tmpl_var stuff>
      More Stuff => <tmpl_var more_stuff>
    </tmpl_loop>

    LOOP 1
    <tmpl_loop stuffs>
      Stuff => <tmpl_var stuff>
    </tmpl_loop>

);
my $ht = HTML::Template->new(
    scalarref         => \$tmpl,
    die_on_bad_params => 1,
);

$ht->param(
    stuffs => [
        { 
            stuff       => 'asdf',
            more_stuff  => 'qwerty',
        },
        { 
            stuff       => 'asdf 2',
            more_stuff  => 'qwerty 2',
        },
    ],
);

print $ht->output;


