in reply to Re: mod_perl and TT2...WITHOUT a calling script?
in thread mod_perl and TT2...WITHOUT a calling script?

You could simply have something like the following in your My::PerlHandler :

use Template; use Apache::Constants qw( :common ); my $tt; sub handler { my ( $request ) = @_; my $file = $request->filename(); $tt ||= Template->new(); my $params = {}; my $out; $tt->process($file, $params, \$out) or do { $request->log_reason( $tt->error ); return SERVER_ERROR; }; + $request->content_type('text/html'); $request->send_http_header; $request->print( $out ); + return OK; }
But that isn't tested and you may need to flesh it out a bit more.

/J\

Replies are listed 'Best First'.
Re^3: mod_perl and TT2...WITHOUT a calling script?
by Anonymous Monk on Jul 10, 2006 at 18:21 UTC
    thanks gellyfish! thats what i needed to know, the $request->filename() method!