[%# test.tmpl #%] ---- [% subj %] ---- [% loop=pref %] Pref: [% name %] >> [% weather %] [% /loop %]
use PetitTemplate; my $q = new PetitTemplate( filename => "test.tmpl", ); $q->param({ subj => "Japan Weather", pref => [ { name => "Tokyo", weather => "Fair" }, { name => "Osaka", weather => "Croudy" }, ], }); print $q->output();