----- Original Message ----- From: "Erich Oliphant" <[EMAIL PROTECTED]> To: "Stas Bekman" <[EMAIL PROTECTED]> Sent: Wednesday, January 15, 2003 9:21 PM Subject: Re: Passing CGI environment to subprograms
> Duh :) Sorry, I thought I included the rev in my original post, yes I am > using 2.0. Hmm, and no hacks or workarounds at this point? That sucks ;) > Well I will poke around the code and see if I can help out. > > Also, are the probs I described with getting the output of spawn_proc_prog() > known? As I indicated that approach did set the env vars correctly, but I > was not able to read the output handle per the example. > > Thanks!!! > > > ----- Original Message ----- > From: "Stas Bekman" <[EMAIL PROTECTED]> > Cc: "Erich Oliphant" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > Sent: Wednesday, January 15, 2003 7:59 PM > Subject: Re: Passing CGI environment to subprograms > > > > Stas Bekman wrote: > > > Erich Oliphant wrote: > > > > > >> Thanks for the reply, just getting back from a short vacation... > > >> > > >> My test programs: > > >> > > >> first.pl > > >> --- > > >> #!/export/home/eoliphan/gnu/bin/perl -w > > >> use strict; > > >> my $key; > > >> open(LOG,"> /tmp/firstdebug.log"); > > >> foreach $key (keys %ENV) > > >> { > > >> print LOG "$key = $ENV{$key} \n"; > > >> } > > >> > > >> `/export/home/eoliphan/gnu/cgi-bin/dump_vars.pl`; > > >> close (LOG); > > >> --- > > >> > > >> dump_vars.pl has the same foreach loop and dumps to a different log > file. > > >> The 'firstdebug.log' has the required CGI vars. The log generated by > > >> dump_vars.pl has what appears to be the enviroment of the httpd > > >> executable > > >> and no CGI vars. > > > > > > > > > It works for me with mod_perl 1.0 and doesn't with 2.0. > > > > BTW, the 2.0 issue is known. And should be resolved at some point. > > > > Here is a quote from modperl_env.c > > > > /* > > * XXX: what we do here might change: > > * - make it optional for %ENV to be tied to r->subprocess_env > > * - make it possible to modify environ > > * - we could allow modification of environ if mpm isn't threaded > > * - we could allow modification of environ if variable isn't a CGI > > * variable (still could cause problems) > > */ > > /* > > * problems we are trying to solve: > > * - environ is shared between threads > > * + Perl does not serialize access to environ > > * + even if it did, CGI variables cannot be shared between > threads! > > * problems we create by trying to solve above problems: > > * - a forked process will not inherit the current %ENV > > * - C libraries might rely on environ, e.g. DBD::Oracle > > */ > > > > Meanwhile I'll add a note to the compat.pod, to avoid bug reports. > > > > __________________________________________________________________ > > 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 > > > > >