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

Reply via email to