> > > It would be nice, in my opinion, to have some way of doing:
> > >
> > > PerlAddVar Fred "Value 1"
> > > PerlAddVar Fred "Value 2"
> > >
> > > And then in your script:
> > >
> > > my @values = $r->dir_config('Fred');
> > >
> > > which gets ("Value 1","Value 2") in @values.
> > >
> > > Any thoughts on this? (I'm not set on the name PerlAddVar, if that's
> > > anyone's concern - but what about the idea of it?)
> >
> > That [the name] would be confusing. How about:
> >
> > PerlSetScalar Foo Bar
> >
> > PerlSetArray Foo A B C
> > PerlPushArray Foo D
> >
> > PerlSetHash Foo key val
>
> 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.
______________________________________________________________________
Stas Bekman | JAm_pH -- Just Another mod_perl Hacker
http://stason.org/ | mod_perl Guide http://perl.apache.org/guide
mailto:[EMAIL PROTECTED] | http://perl.org http://stason.org/TULARC/
http://singlesheaven.com| http://perlmonth.com http://sourcegarden.org
----------------------------------------------------------------------