in reply to HTML::Template data types problem
my %content = { title => 'hi', body=>'testing' }; my $page = $obj->Template->format (content => %content);
This assigns an anonymous hash reference to a hash. If you had warnings on, you would see: "Reference found where even-sized list expected" in your error log. You probably want to do something like this:
my $content = { title => 'hi', body => 'testing' }; my $page = $obj->Template->format( content => $content );
A TMPL_LOOP expects an array of hash references. So in your format method, you'll need to stick the hashref inside an array. But based on what you posted, it doesn't look like you ever attempt to shift the hashref off of @_, you just pass $self->{content} to the template. That just contains an empty array reference.
|
|---|