in reply to Re^2: CGI::Ajax + Template::Toolkit Question
in thread CGI::Ajax + Template::Toolkit Question
Rather than passing the configuration variables in $config to process, as chargrill noted, you can specify these when creating the $tt object:
and then specify the variables you want processed in your template in process:my $config = { INCLUDE_PATH => '/tt', INTERPOLATE => 1, POST_CHOMP => 1, PRE_PROCESS => 'header', EVAL_PERL => 1, }; my $tt = Template->new($config);
sub main_page { my $output = ''; my $template = 'main.tt'; my $vars = { title =>'AJAX Login'}; $tt->process($template, $vars, \$output) || die $tt->error(); return $output; }
In Section
Seekers of Perl Wisdom