I would expand on this general principle.
Keep scope of variables as small as possible. Use my rather than our, except where needed. The TT equivalent of this is the localization of variables that occurs with INCLUDE and MACRO directives.
Look for edge conditions, and build unit tests for them. In Perl code, Devel::Cover can often help here. When writing unit tests for templates, provide test cases with extremes of data, such as your results array with an empty first element.
--
Oh Lord, won’t you burn me a Knoppix CD ?
My friends all rate Windows, I must disagree.
Your powers of persuasion will set them all free,
So oh Lord, won’t you burn me a Knoppix CD ?
(Missquoting Janis Joplin)
In reply to Re: Keep Those Conditionals Tight
by rinceWind
in thread Keep Those Conditionals Tight
by friedo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |