[Templates] FOREACH enhancement request

Hans Juergen von Lengerke lengerkeh@sixt.de
Thu, 2 Oct 2003 15:41:53 +0200 (CEST)


Hello Robbin,

> However, If my $config only has one book defined, it would look like this:
> (in real life I am importing a XML file with XML::Mini)
>
> my $config={
>     books => {
>         book => { title => "title" },
>     }
> };
>
> and that does not work with my templates, because the
> FOREACH loop will only process arrays.

Did you check out the virtual method "list"? Take a look in
Template::Manual::VMethods, I think this is what you want.

Hans