Stas Bekman wrote:
It seems that you are still confused between $r and Apache::Request objects, which are two different things. The former is a request object which you can do many things with. The latter is just a GET/POST data container which gives you methods to access that data.

Actually, if it sounds like there's confusion, I was just stating my original questions incorrectly. I'm quite familiar with the differences between the two and in the project I'm working on, I have a simple class that abstracts the request (and acts as a singleton holding onto the current $r and $apr). The reason for this was to simplify some site specific things, but also to encapsulate access to things like form data, cookies, client info (ip address, etc.), which in turn should ease migration to MP2.


The *real* problem was a session factory style handler in PerlInitHandler would grab $r, instantiate $apr (with Apache::Request->new($r)), and perform some minor tasks. In the process, $apr would presumably call parse() and "eat" the GET / POST parameters making it unavailable later on during the request cycle. Subsequent calls to $apr->param('whatever') and $apr->param() would yield nothing in the content generation phase.

Getting $r in handler() of both phases works fine, but not $apr so I needed to use Apache::Request->instance($r) to make form content available to both handlers during the same request. I assume this is because Apache::Request->instance() takes measures not to parse things twice, or something similar.

The questions about Apache->request() being deprecated was more an unrelated side note as I understand it has no direct relationship with Apache::Request. I apologize if I phrased my original email incorrectly.

If you don't want to pass $r around, you can easily use the Class::Singleton class to get $r from anywhere under both mod_perl generations. There is even Apache::Singleton. See:
http://search.cpan.org/search?query=singleton&mode=all

That is also interesting. Thanks.


Thanks again for the quick reply and all the help.
--
Eric Sammer
[EMAIL PROTECTED]
http://www.ineoconcepts.com

--
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html



Reply via email to