Hi all,

I decided to start using Template Toolkit for a variety of reasons instead
of HTML::Template which is integrated into CGI::App. I encountered a
strange bug but am not entirely sure what caused it. Here's what my code
looked like using HTML::Template inside one of the run-mode handlers.

sub ... {
  ...
  return $template->output('template');
}

Changing it to return the output of Template Toolkit like this didn't have
the desired effect...

sub ... {
  ...
  return $template->process('templatefile.tmpl',$vars);
}

It would return the page, but I would see the text of the page, not the
actual HTML rendering of the page. The fix I used looks like this:

sub .. {
  my $html;
  ...
  $template->process('templatefile.tmpl',$vars,\$html);
  return $html;
}

While this solution does work, I was wondering if anyone knows why I
couldn't directly return the template process output. Anyone else using
Template Toolkit with CGI::App have any suggestions or other tips using
this combo?

Thanks,
Ben



---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/[EMAIL PROTECTED]/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to