Re: [htmltmpl] Data -> template (brain -> Perl)
Brought to you by:
samtregar
From: Sam T. <sa...@tr...> - 2009-09-11 16:37:19
|
On Fri, Sep 11, 2009 at 11:06 AM, Robert <si...@gm...> wrote: > I am using XML::Simple to get some "simple" XML data. > > $template->param( DATA => sub { > for my $list ( @{ $data->{list} } ) { > print "<p>$list->{name}[0]</p><p>$list->{description}[0]</p>"; > } > } > ); > > That prints the data to the template at the top...it doesn't go into the > DATA var. Do I need to do the for loop outside of the $template-param? > Don't print() the data, instead build up a string and return() it. -sam |