You've done the assignment to $tmpID for the "1000" case by using my()
inside the scope of the braces. The setting to "markh" is not going to
be seen outside of those braces, you will always get the $tmpID being
"epic" in your INCLUDE_PATH. Just removing that my() will fix the
issue.




On 6 September 2012 14:46, Mark Haney <ma...@abemblem.com> wrote:
> I'm trying to get the INCLUDE_PATH in my template to include a perl
> variable.  Here's the code I'm trying to use:
>
>>  my $tmplID="epic";
>>     my $user_id=`id -u`;
>>     if ($user_id = "1000"){my $tmplID = "markh";}
>>
>>     my $template = Template->new({
>>     # where to find template files
>>     INCLUDE_PATH =>
>> ['/home/'.$tmplID.'/work/epic.git/code/embmon-web/src',
>> '/home/'.$tmplID.'/work/epic.git/code/embmon-web/lib'],
>
>
> However, I'm not getting the value of $tmplID passed as my script is
> bombing.  I don't have any debug data yet, but I'm wondering if there is a
> better way to do this? Or ideas on how to fix it.
>
> Thanks.
>
>
>
> --
>
> Mark Haney
> Software Developer/Consultant
> AB Emblem
> ma...@abemblem.com
> Linux marius.homelinux.org 3.5.1-1.fc17.x86_64 GNU/Linux
>
> _______________________________________________
> 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

Reply via email to