>>>>> "Evan" == Evan Carroll <[EMAIL PROTECTED]> writes:
Evan> Could someone please juxtapose PROCESS w/ ARGS, vs, MACRO? I'm confused
Evan> as to which one to use. PROCESS can operate on a named block, and send
Evan> arguments into that block for invocation, MACRO does the same thing? Is
Evan> the difference just semantic?
BLOCK requires INCLUDE/PROCESS
MACRO creates a new function
[% BLOCK a_block; %]text with [% aparameter %] in here[% END %]
[% MACRO a_func(aparameter) BLOCK; %]text with [% aparameter %] in here[% END %]
...
via include: [% INCLUDE a_block aparameter = "fred" %]
via macro: [% a_func("fred") %]
A macro always requires a fixed number of parameters, and had to have been
already processed earlier. A block can have defaults for parameters. An
include can also process an entire separate file: it doesn't have to be a
block already seen.
--
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