[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-modperl
Subject:    Re: Apache::Dynagzip not seeing my headers from Apache::Registry
From:       Slava Bizyayev <sbizyaye () outlook ! net>
Date:       2004-12-29 22:04:01
Message-ID: 1104357841.2569.58.camel () hp-notebook ! slav ! net
[Download RAW message or body]

Hi Alex,

Yes, $r=Apache->request was my another suspect...

On Wed, 2004-12-29 at 15:00, Alex Greg wrote:
> I tried adding "my ($fh, $status) = $r->filter_input();" to the
> script, but got the same error.
> 
> After a bit of digging, I found someone else had the same "Not a HASH
> reference" error, to which Ken said:
> 
> "This sounds like the error that would happen if AxKit used 
> "$r = Apache->request" somewhere.  Apache->request is broken in terms of
> subclassing - it won't return the subclass object."
> 
> I am getting $r from Apache->request. The reason I'm doing it this way
> (rather than "$r = shift;" at the top of the module) is because our
> application has a subroutine called print_content_type which is
> invoked by all the other scripts / modules to send HTTP headers.
> Currently it does this by just printing them directly out. I want to
> make the changes in this subroutine only.
> 
> Is there an easier way to accomplish this, or is accessing
> Apache->request the best way forward?

Definitely not (from my point of view), unless you want to dig into
Apache->request and fix it. I would prefer to write a customizable
handler (might be pretty generic, but Apache::Filter compatible) in
order to reuse the code of your application from that handler. It would
be a short way to make your application running under the mod_perl, and
further re-engineering through the use of other phases of the request
processing flow will be well prepared.

Good luck!
Slava
http://www.lastmileisp.com/



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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic