perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frank Wiles <>
Subject Re: mod_perl 2.0 custom directive clarification
Date Mon, 20 Feb 2006 20:49:26 GMT
On Mon, 20 Feb 2006 21:32:02 +0100 (Dag-Erling Smørgrav) wrote:

> To quote a slightly longer excerpt:
> | This object can be later retrieved at request time via:
> |
> |  my $dir_cfg = $self->get_config($s, $r->per_dir_config);
> which is clearly incorrect, unless "at request time" means something
> different to you than it does to me.
> This is in the "Directive Callback Subroutine" section, see

  Yes, that's exactly what I'm talking about. :) You are referencing
  the wrong section for how to use these configs in your sub handler().

  When using custom configuration directives there are essentially 
  three steps involved: 

  1) Define the directives via @directives and load it in. 

  2) Write the callbacks that are used by Apache when reading in those
     config options.  This is what you are reading about in "Directive
     Callback Subroutine".  These callbacks are used to put the data
     into whatever data structure you want to save it under and/or
     validate the data when the config file is parsed. 

  3) You use Apache2::Module::get_config() to actually retrieve the
     configuration *data* in your sub handler(). 

  Hopefully that is more clear.  

   Frank Wiles <>

View raw message