Perl Monk, Perl Meditation | |
PerlMonks |
Re: Re: Re: Passing arguments to subroutines using Template Toolkitby perrin (Chancellor) |
on Nov 30, 2001 at 02:34 UTC ( [id://128485]=note: print w/replies, xml ) | Need Help?? |
You only need to pass the sub as a reference if you plan to call it from within the template. Passing it as a ref lets you do this in your template:
Personally, I like to avoid callbacks from within templates when possible, but this can be useful for things like passing in a subroutine that escapes HTML characters.
In Section
Seekers of Perl Wisdom
|
|