At 1:39 PM -0800 2/1/02, [EMAIL PROTECTED] wrote:
>I'm wondering if there is a way that I can mark or remeber that
>I've seen a particular dir_config during a previous request. The
>motivation is performance related - so that I can set up for
>particular set of "PerlSetVar" values only the once. Then
>subseqeuent requests to that child will use a previously
>determined value (instanciated object).
>
>IE: in my httpd.conf I have -
>
>PerlSetVar myvalue 100
>
><Location "/test">
>       PerlSetVar myvalue 200
></Location>
>
><Location "/different">
>       PerlSetVar myvalue 300
></Location>
>
>So - request 1 - GET /test
>       I check dir_config("myvalue") and setup.
>       Can I mark that I was here; sorta like the equivalent of
>       <Location "/test">
>               PerlSetVar myvalue   200
>               PerlSetVar signature myvalue_200
>       </Location>
>

I'm not sure if I understand...

I've done something in one of my modues in the past...

package MyHandler;

our $INITED = 0;

our %CONFIG = ();

sub handler {
     ....
     unless($INITED) {
         %CONFIG = $self->get_config($r);
         $INITED = 1;
     }
     ....
}


That way I only have to get_config once per forked process...  This 
is very useful for static (or near static) data.  In this example 
get_config was pulling configuration directives from an Oracle 
database.

Rob


 

--
When I used a Mac, they laughed because I had no command prompt. When 
I used Linux, they laughed because I had no GUI.  

Reply via email to