[% SET display_template = 'bar.tt' %]
[% PROCESS foo.tt %]
then later on, in "foo.tt":
[% PROCESS display_template %]
but that's not working - process tries to look for 'display_template' as a
file, rather than first interpolating it as a variable, and thereby
processing "bar.tt".
Check out 'perldoc Template::Manual::Directives', which has the following example (INCLUDE/PROCESS being interchangable in this case):
[% myheader = 'my/misc/header' %]
[% INCLUDE myheader %] # 'myheader'
[% INCLUDE $myheader %] # 'my/misc/header'
[% INCLUDE "$myheader" %] # 'my/misc/header'
So you should be able to use:
[% PROCESS $display_template %]
