As you may know, Mark Stosberg and I are working on additions to HTML::Template. Mark has created HTML::Template::Pluggable, which adds a callback system to HTML::Template, similar to the successful one in CGI::Application. This will make creating plugins for HTML::Template a lot simpler.
He also started on HTML::Template::Plugin::Dot, which hooks into param to provide the magic-dot notation you might know from the Template Toolkit. I am currently enhancing that to allow mixing hashes and objects and more.
Here's an example script I have just written:
use HTML::Template::Pluggable; use HTML::Template::Plugin::Dot; use My::Feed; # a Class::DBI object
my $t = HTML::Template::Pluggable->new( scalarref => \ q{ Feed:at Items: " });" by ( )
my $feed = My::Feed->retrieve(1); $t->param( feed => $feed, items => [ map { {item => $_} } $feed->items ] );
print $t->output;
Feed: Asynchrss at http://www.asynchrss.com Items: "News" by rhesa (21-10-2004) "More" by zsane (04-07-2005)
Feed: Asynchrss at http://www.asynchrss.com Items: "News" by rhesa (10/21/2004) "More" by zsane (07/04/2005)