Hello,

I'd like to have apache 404 errors and
template-toolkit errors both go to the same error
page. I've set httpd.conf, but I'm having trouble with
TT. I've modified the code from the TPC Slide Show
(NOT_FOUND instead of SERVER_ERROR), but in either
case, an extra header shows up. Is there anyway to do
this without the extra header appearing?

Thanks.
--

package MyPackage;
use strict;
use Template;
use Apache::Constants qw( :common );

sub handler {
    my $r = shift;

    $r->content_type('text/html');
    $r->send_http_header;

    my $template = Template->new({
        INCLUDE_PATH => '/usr/local/templates',
    });

    my $file = 'missingtemplate.html';
    my $vars = {
        message => 'The Cat Sat on the Mat',
    };

    $template->process($file, $vars, $r) || do {
        $r->log_reason($template->error,
$r->filename);
        return NOT_FOUND;
    };

    return OK;
}
1;

__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com


Reply via email to