Sorry to bring up PerlAddVar again, but this time I have a legitimate bug.
It stems from what I reported last time about items in Apache::Table not
being visible outside a <Location> directives:
that is, given:
Alias /test /usr/local/apache/test
# this outside value of foo doesn't get seen!
# PerlSetVar here doesn't make a difference either
PerlAddVar foo "outside"
<Location /test>
SetHandler perl-script
PerlHandler Test::AddVar
Order Allow,Deny
Allow from All
PerlSetupEnv Off
PerlAddVar foo "one"
PerlAddVar foo "two"
PerlAddVar bar "bar"
PerlAddVar foo "three"
</Location>
package Test::AddVar;
use Apache::Constants qw( OK );
use strict;
sub handler {
my $r = shift;
$r->send_http_header("text/plain");
my @foo = $r->dir_config->get('foo');
print "get() foo\n";
print join "\n", @foo;
print "\ndo()\n";
$r->dir_config->do( sub {
my($key, $value) = @_;
print("$key => $value\n");
1;
});
print "done!";
return OK;
}
1;
results:
get() foo
one
two
three
do()
foo => one
foo => two
bar => bar
foo => three
done!
-Geoff