in reply to Re^3: Include code in Template Toolkit
in thread Include code in Template Toolkit

Excellent.

Another thing that I’ve done a few times (frankly, since I overlooked the existence of eval until now ...) was to create another template object-instance, use it to generate some output, then dropped it into a variable.   Which, I presume, is more-or-less what eval does.