I'm fairly new at Perl and the use of the Template toolkit.
I'm not getting the results I would expect with INTERPOLATE => 1. I would
expect to be able to reference $variables in my template file. Below is my
program, template file and output.
With INTERPOLATE => 1 all I see is blanks where my values for $name and
$dummy should be. Not working !!!!
With INTERPOLATE => 0 the output simply prints Name = $name and dummy
= $dummy. This is what I would expect.
I'm sure I had this working. The only major thing I did since then was
install DateManip toolkit. Could this toolkit somehow have corrupted the
Template toolkit ?? I actually reinstalled the Template Toolkit to see if
this would help.
What am I doing wrong ? I am using the latest Template Toolkit v2.06
Thanks for the help, Tom
#--------------------------------- program ------------------------------
#!/usr/local/bin/perl
use Template;
$name = "Joe Blo";
$dummy = 6;
print "Date = $date, Dummy = $dummy\n";
my $tt = Template -> new ({
INTERPOLATE => 1,
INCLUDE_PATH => '/export/home/prod/tomw'
}) || die "$Template::ERROR\n";
my %data1 = (tester => 'CAT-33', report => 'BCM lot');
$tt->process('ssmc_template_small', \%data1, 'output') || die $tt->error;
----------------------------------------------------template
file---------------------------------
Tester : [% tester %]
Name = $name
dummy = $dummy
End of file
---------------------------------------------------output
file----------------------------------------
Tester : CAT-33
Name =
dummy =
End of file