in reply to Re: Re: Passing arguments to subroutines using Template Toolkit
in thread Passing arguments to subroutines using Template Toolkit

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:
[% filler(some_var) %]
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.
  • Comment on Re: Re: Re: Passing arguments to subroutines using Template Toolkit
  • Download Code