> -----Original Message-----
> From: darren chamberlain [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, March 15, 2001 7:19 AM
> To: modperl
> Subject: Re: %ENV
> 
> 
[snip]
 
> Try fiddling with $r->subprocess_env; I've had good results 
> that way. e.g.:
> 
>     $r->subprocess_env('TEST_VAR', 1);
> 
> I haven't tried using %ENV, but I was under the impression it was
> tied to the same internal Apache::Table object as
> $r->subprocess_env,

I don't think that is right, since that would mean that you could do
case-insensitive lookups on %ENV...
  #!/usr/bin/perl

  my $r = shift;

  $ENV{Foo} = 'Foo';
  $r->subprocess_env(Bar => 'Bar');

  my $env_foo = $ENV{Foo};
  my $env_bar = $ENV{BAR};

  my $sp_foo = $r->subprocess_env('FOO');
  my $sp_bar = $r->subprocess_env('BAR');

  $r->send_http_header('text/plain');
  print "env_foo is: $env_foo\n";
  print "env_bar is: $env_bar\n";
  print "sp_foo is: $sp_foo\n";
  print "sp_bar is: $sp_bar\n";

yields:

  env_foo is: Foo
  env_bar is: 
  sp_foo is: 
  sp_bar is: Bar


< which means that setting $ENV{'TEST_VAR'}
> should work as well.

  that's right, though :)

  If you are going to get $r anyway, you are better off using pnotes() to
stash stuff, since it takes less overhead than populating %ENV with
subprocess_env().

--Geoff

> 
> Make sure you are setting this in the parent request, if you are
> in a subrequest:
> 
>     $r = ($r->is_main) ? $r : $r->main;
> 
> (darren)
> -- 
> The world is coming to an end!  Repent and return those library books!
> 

Reply via email to