[Israel.pm] mod_perl question: Ending an apache request with an OK status inside a PerlFixupHandler?

Yuval Yaari yuval at windax.com
Wed Apr 28 08:44:56 PDT 2004

I tried:
$template->process($file, $vars, $r) or do { 
$r->log_error($template->error(), $file); return 
Apache::Constants::DECLINED(); };
return Apache::Constants::FORBIDDEN();

And it gives me the right results, AND sends headers (again) and 
"Forbidden You don't have permission to access.......".
It doesn't call the next handler though.

To be honest I did manage to do what I want but I don't like the 

I store the template output in a scalar, and then:
$r->custom_response(Apache::Constants::FORBIDDEN(), $ttoutput);
return Apache::Constants::FORBIDDEN();

Also since I put it all in a subroutine called report_error, I call it 
(from the handler subroutine) as "return report_error" - is there a way 
to return the status from inside that subroutine (just to make 
everything look nicer, it's really not that important)?


Issac Goldstand wrote:

>Don't return OK.  Return FORBIDDEN from the fixuphandler too.

More information about the Perl mailing list