I wrote:
> When I run this template (assuming this is debug.tt):
> 
[...]
> 
> ...I get 'Deep recursion on subroutine 
> "Template::Context::process"' errors,
> even with %options{RECURSION=>1}.

OK, never mind this, I was reassigning the Stash to the hash variable in the
debug template. I have now separated them into two templates:

----test.tt---------------------------------------
[% USE Stash %]
[% top = Stash.stash() %]
[% USE Dumper Indent=1 %]
<html>
<head><title>Variables</title></head>
<body>
[% INCLUDE debug.tt hash=top %]
</body>
</html>
--------------------------------------------------

----debug.tt--------------------------------------
<pre>hash = [% Dumper.dump(hash) %]</pre>
<table>
    [% FOREACH key = hash.keys %]
    [% val = hash.$key %]
    <tr>
        <th>[% key %]</td>
        <td>
            [% IF val.keys %]
                [% INCLUDE debug.tt hash=val %]
            [% ELSE %]
                [% val %]
            [% END %]
        </td>
    </tr>
    [% END %]
</table>
--------------------------------------------------

What happens is the Dumper correctly dumps the data structure (which is
actually a Template::Stash::XS object), but the FOREACH doesn't see the
keys. Does FOREACH ignore a blessed hash?

- Mark.


_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to