On Mon, 26 Jul 2004, Garrison Hoffman wrote:
> I'm attempting to use Text::Template w/ mp2. The following code
> generates no error in the log, produces the expected output but also
> tacks on the 200 OK The server encountered an internal error...
>
> Is this an issue with Text::Template or am I doing something wrong?
>
> package Codefix::ttdemo;
> use strict;
> use warnings;
> use Text::Template;
> use Apache::RequestRec ();
> use Apache::RequestIO ();
> use Apache::Const -compile => qw(OK);
>
> sub handler {
> my $r = shift;
> my $filename = '/var/www/test';
> my $template = Text::Template->new(DELIMITERS => ['<?', '?>'], SOURCE
> => "$filename") or die "Couldn't construct template:
> $Text::Template::ERROR";
> my %vars = (filename => "$filename");
> $r->content_type('text/html');
> my $result = $template->fill_in(HASH => \%vars);
> if (defined $result) { print "$result\n"; }
> else { die "Couldn't fill in template: $Text::Template::ERROR" }
> }
>
> 1;
Does it help to have
return Apache::OK;
as the last line in the handler? (you might also want to
return Apache::SERVER_ERROR, and log the
$Text::Template::ERROR, if that case arose).
--
best regards,
randy
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html