On Mon, 1 May 2000, Stas Bekman wrote:
> > Would it not be possible / preferable to handle this kind of thing from
> > within <Perl> blocks? (localized to <location>, <directory> etc. blocks,
> > even) At least, something along these lines would cut down on the amount
> > of configuration syntax that would needed to be coped with.
>
> <Perl> blocks get evaluated in the Apache::ReadConfig namespace, which
> knows nothing about <location> it's placed in. What you can do is to set
> FQDN variables from within <Perl> section:
>
> <Perl>
> $MyEnv::FOO = "bar"
> @MyEnv::FOO = qw(bar foo);
> %MyEnv::FOO{bar} = "barfoo";
> </Perl>
>
> It doesn't matter whether you define the package MyEnv or not, since it's
> autovivified when first time referenced to.
>
> and then in your code:
>
> print $MyEnv::FOO;
>
> will do.
The thing I don't like about this is that I'm writing code for non-perl
programmers. Littering .htaccess files with perl code is not something I
want to be getting into. I don't mind too much the work around that is:
PerlSetVar MyVar "name => value, \
other => value, \
etc => continued"
but I don't particularly think its well suited to setting multiple values
for non-programmers, and it breaks as soon as you start needing spaces in
values or something wierd that happens to break the parser code (from the
Eagle book).
--
<Matt/>
Fastnet Software Ltd. High Performance Web Specialists
Providing mod_perl, XML, Sybase and Oracle solutions
Email for training and consultancy availability.
http://sergeant.org http://xml.sergeant.org