>>>>> "Tony" == Tony Bowden <[EMAIL PROTECTED]> writes:
Tony> On Sat, Jan 17, 2004 at 09:42:58AM -0800, Randal L. Schwartz wrote:
Tony> wrap *Template::Directive::macro, pre => sub { push @def, $_[1] };
Tony> But I can't see how to do the equivalent for which ones are called.
>> Set up a sentinel on each code-def that says "I was called" into an
>> external table. Then look at the table after your tests were run.
Tony> Yeah, I know the theory. But I can't see where to put that hook.
According to my reading of Template::Directive::macro, $_[2] is the
Perl code that will become the definition of the macro. Just hack $_[2]
there to prepend a Perl code line that mucks with a global hash.
Untested, but it looks like it should work.
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates