Return-Path: Delivered-To: apmail-perl-modperl-archive@www.apache.org Received: (qmail 52863 invoked from network); 3 May 2004 06:42:25 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 3 May 2004 06:42:25 -0000 Received: (qmail 60120 invoked by uid 500); 3 May 2004 06:41:49 -0000 Delivered-To: apmail-perl-modperl-archive@perl.apache.org Received: (qmail 59992 invoked by uid 500); 3 May 2004 06:41:48 -0000 Mailing-List: contact modperl-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Delivered-To: mailing list modperl@perl.apache.org Received: (qmail 59975 invoked from network); 3 May 2004 06:41:48 -0000 Date: Mon, 03 May 2004 08:39:45 +0200 From: Helmut Zeilinger To: Geoffrey Young cc: modperl@perl.apache.org Subject: Re: $r->status() ? Message-ID: <2520000.1083566385@localhost> In-Reply-To: <4093A8F9.8060509@modperlcookbook.org> References: <3130000.1083409935@localhost> <4093A8F9.8060509@modperlcookbook.org> X-Mailer: Mulberry/3.1.2 (Linux/x86) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Yes helped .. thanks a lot for explaining this again! Helmut --On Saturday, May 01, 2004 09:41:13 -0400 Geoffrey Young wrote: > > > Helmut Zeilinger wrote: >> Hi all, >> >> i am confused about $r->status(). >> When do i have to set this "manually" - if ever? > > you should never set $r->status from a handler. > >> I searched for documentations about this item, but i did not find a >> detailed explaination. > > I've explained it on this and the dev list a few times, so you should find > discussions in the archives. it's also in the mod_perl developer's > cookbook. > >> >> My problem is, what's the difference between >> >> sub handler { >> .. >> $r->status(404); >> return (?); >> } > > that idiom is used with Registry scripts and Registry scripts only. it's > basically a hack that let's Registry scripts return something other than > ok. note that Registry sets $r->handler back to whatever it was before > you messed with it, and it is the only valid use of $r->status($foo). > >> >> and >> >> sub handler { >> .. >> return (HTTP_NOT_FOUND); >> } >> >> [? means that i don't know what to return] > > the return value of the handler is the status that gets set on the HTTP > Response Line. $r->status is really an internal bookeeping variable for > apache - most of the time it's the same as the response line status, but > if you set it manually it will mess up any future error document cycles, > since that's the marker that apache uses for keeping track of recursive > errors (the "additionally, a 500 server error was encountered" foo). > > again, you can search the archives and MPDC for more details. > > HTH > > --Geoff > -- 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