http://qs321.pair.com?node_id=105885


in reply to (elbie): Template Toolkit, and delaying the execution of a function
in thread Template Toolkit, and delaying the execution of a function

It would be cleaner to change you code to return values, but TT does provide a directive that automatically ties STDOUT for you. Try this:

{#PERL#} $stash->get('show_elements'); {#END#}

Or just call &show_elements in some other way from within the PERL block.