On Sat, 2005-01-08 at 11:22 -0800, Bill Moseley wrote:
> That's the point, I guess.  How do I know if I need to prevent
> side-effects or not?

If your approach to TT is to gather your data ahead of time and pass it
in, you probably aren't setting variables, or setting so few that you
are aware of them all, so use PROCESS.  If your approach is to set lots
of things in the stash via plugins and the like from inside of your
templates, you probably should use INCLUDE.

> For example, if I want to show a list of files by calling
> "show_file.tt" how do I know that "name" is going to get written
> over?  Every time I want to INCLUDE or PROCESS some template I need to
> go and look to see if it has side-effects and then use INCLUDE if it
> does.

If you're setting variables all over the place, and you don't know them
well enough to be sure there are no collisions, use INCLUDE.  I don't
set variables in my templates, so I use PROCESS.

- Perrin


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

Reply via email to