[San-Diego-pm] Recurse through trees

Emile Aben emileaben at gmail.com
Fri Mar 17 15:52:50 PST 2006

> Emile> but datadumping $stash->get('html_node_visitor') finds this is an 'undef'?
> Ahh, that's an invocation.  Try adding a backslash in front of
> html_node_visitor as in:
> [% tree.traverse(\html_node_visitor) %]

That's slightly better in that it doesn't produce an error message,
doesn't produce html either

> And when I say "try", I mean "I have no frigging idea if this works but
> I saw it once in the docs and maybe it'll help here".
> :-)

Reread the Template Toolkit basics some more and have become more and
more convinced that this goes wrong because the html_node_visitor
MACRO/CODEref gets invoked/evaluated before it gets passed to the tree
to traverse.

Bummer, so looks like either I go back to my old code or write an
alternative template-stash that let's me delay code execution. Hmmm,
which one
would my boss like more ...


More information about the San-Diego-pm mailing list