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;

-- 
-------------------------------------------------
 Garrison Hoffman, Technology Consultant
 (718) 210-3445       http://codefix.net
-------------------------------------------------


-- 
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

Reply via email to