On Wed, 2003-06-04 at 14:55, Issac Goldstand wrote:
After a few fruitless days of fiddling with this, I find myself getting nowhere... Can anyone really explain how Apache::ReadConfig and/or direct me to the source code (for handling the namespace, not the code for <Perl> sections)
Was Issac asking about mp1 maybe? Guys, please make yourself clear when you ask this kind of questions. Philippe's answer is for mp2, but it's similar in mp1.
Simple as simple gets.
If you have
<Perl handler=My::Handler> $foo = 1; $bar = 2; </Perl>
Will call: My::Handler->handler
sub My::Handler::handler : handler { my($self, $parms, $args) = @_; #do your thing! }
$self is self-explanatory $parms is the Apache::CmdParms for this Container, for example, you might want to call $parms->server() to get the current server.
$args is a APR::Table of your arguments, the 2 guaranteed ones will be:
$args->{'handler'} = 'My::handler::handler'; # in this case $args->{'package'} = 'Apache::ReadConfig';
And $args->{'package'} will be the name of the package your code got 'eval'ed into, for this example
$Apache::ReadConfig::foo = 1; $Apache::ReadConfig::bar = 2;
From then on, it's up to you to navigate the namespace and do your thing. For inspiration you can look at lib/Apache/PerlSections.pm, the default handler for this.
Also, keep in mind that as things stand right now, this is a bit buggy, pending one of many possible fixes (by me ;-()
More info on the current borked state ican be found around this thread : http://marc.theaimsgroup.com/?l=apache-modperl-dev&m=105401421410654&w=2
Does this help you ?
Issac
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--
__________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
