On Sat, Jan 17, 2004 at 03:46:57PM -0800, Randal L. Schwartz wrote:
> 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.

Yuck-o-rama!

I now have the delicious:

        wrap *Template::Directive::macro, pre => sub {
                push @defined, $_[1];
                $_[2] = qq{ \$main::called{"$_[1]"}++; } . $_[2];
        };

which does indeed seem to do the trick (although makes me feel rather
ill!)

Thanks.

Tony


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

Reply via email to