You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Hadmut Danisch <ha...@danisch.de> on 2000/11/05 15:59:17 UTC

lookup_uri and Environment Variables?

Hi,

sorry if this was discussed before or if it is
a dull question, but I couldn't find any other
help than subscribing to this list:


I have a Perl Handler Module (PerlAuthenHandler)
and want to lookup environment variables set by other
modules, e.g. the variables set by apache-ssl for the
DN,...

To do so, I have the folling piece of code:

  $subr = $r->lookup_uri($r->uri);
  $envs = $subr->subprocess_env;
  
  foreach $i ( sort keys %$envs )
   { $r->log_error("SE $i ",$envs->{$i});
   }


This code finds only UNIQUE_ID and variables set by
the SetEnv directive.

Could anyone give me a hint how to access the other
variables?


regards
Hadmut 

Re: lookup_uri and Environment Variables?

Posted by Doug MacEachern <do...@covalent.net>.
On Sun, 5 Nov 2000, Hadmut Danisch wrote:

> 
> Hi,
> 
> sorry if this was discussed before or if it is
> a dull question, but I couldn't find any other
> help than subscribing to this list:
> 
> 
> I have a Perl Handler Module (PerlAuthenHandler)
> and want to lookup environment variables set by other
> modules, e.g. the variables set by apache-ssl for the
> DN,...
> 
> To do so, I have the folling piece of code:
> 
>   $subr = $r->lookup_uri($r->uri);
>   $envs = $subr->subprocess_env;
>   
>   foreach $i ( sort keys %$envs )
>    { $r->log_error("SE $i ",$envs->{$i});
>    }
> 
> 
> This code finds only UNIQUE_ID and variables set by
> the SetEnv directive.
> 
> Could anyone give me a hint how to access the other
> variables?

the table has not been initialzed at that stage, you need to force that
yourself, from ch9 of the eagle book:

Finally, if you call I<subprocess_env()> in a void context with no
arguments, it will reinitialize the table to contain the standard
variables that Apache adds to the environment before invoking CGI
scripts and server-side include files:

 $r->subprocess_env;