It's usually helpful to add what problem you are trying to solve as there may 
be more than one way to solve it.

C. Chad Wallace's solution is probably close to what you want and may be your 
best bet.

If you need this data at runtime and are ONLY looking for variables that have 
changed, you could do something creative with some perl blocks:

[% PERL %]
print $stash->_dump();
[% END %]

Another alternative would be overriding the Stash class to create a list of 
variables that can be displayed after the run. If you want to be able to check 
out variables accessed/wrote by other templates processed by the current one, I 
think you'd probably be stuck with doing it at runtime, since those templates 
usage can be dynamic.

Finally, if you need it at compile time, maybe you could do something with the 
compilation process itself. That would appear to require Template::Directive 
hacking, but I could be wrong.

-- Josh

E R wrote:
> Hi,
> 
> After compiling a template, Is there a way to get a list of all
> variables that it references?
> It seems that this is something the compiler could keep track of if it
> doesn't already.


_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates

Reply via email to