thx that works. but why is this not working now? it seems it is not working
inside the File()
[% TRY %]
[% USE File("myfile.$userid") %]
[% INCLUDE "myfile.$userid" %]
[% CATCH File %]
[% INCLUDE "myfile.general" %]
[% END %]
On Friday, August 15, 2014 1:39 PM, Dave Cross <d...@dave.org.uk> wrote:
On 15/08/14 19:22, Rajeev Prasad wrote:
>
> calling script code snippet:
>
> $vars = {
> userl => $userid
> };
>
> my $tt = Template->new();
> $tt->process($vars)|| die $tt->error();
>
> the template....
> [% IF userl == 'ABC' %]
> [% INCLUDE myfile.ABC %]
> [% ELSIF userl == 'DEF' %]
> [% INCLUDE myfile.DEF %]
> [% END %]
>
> it is working, but it is a long list so i want to change it to:
>
> [% INCLUDE myfile.[% userl %] %]
>
> THIS is not working. can someone tell me why, pl?
It's not working because you can't embed directives within directives.
You want this:
[% INCLUDE "myfile.$userl" %]
Cheers,
Dave...
_______________________________________________
templates mailing list
templates@template-toolkit.org
http://mail.template-toolkit.org/mailman/listinfo/templates
_______________________________________________
templates mailing list
templates@template-toolkit.org
http://mail.template-toolkit.org/mailman/listinfo/templates