On Mon, 12 Mar 2001, Khachaturov, Vassilii wrote:

> When I upgraded from
> Solaris Apache/1.3.14 (Unix) mod_perl/1.24_01
> to
> Solaris Apache/1.3.17 (Unix) mod_perl/1.25
>
> the following code in my debugging httpd.conf broke:
>
> <Perl>
> sub WWW_DIR () { $ENV{'HOME'} . '/www' ; } # this sub will persist to next
> <Perl>
> ... more code, using WWW_DIR sometimes
> </Perl>
>
> .. more plain apache conf stuff here
>
> <Perl>
> $AxCacheDir = WWW_DIR . '/htdocs/x/cache';
> </Perl>
>
> While this worked before, it now generates an undef sub called at the second
> <Perl>
> section. Redefining it there again works, but emits strange prototype
> mismatch stuff
> at the 2nd <Perl> calling of the routine.
> To restore the old behavior I had to define it again without the brackets
> (the args
> prototype) at the 2nd section.
>
> Was this change intentionally done (why?!), or is it a by-product of some
> other code advances?
> What is the correct way of passing Perl stuff from one <Perl> section to
> another?

Please read
http://perl.apache.org/guide/config.html#Apache_Configuration_in_Perl
and you will understand how C<Perl> sections work.

I also don't understand why are you trying to use sub to define a
variable, which is pretty useless, since you use it only during
configuration. Also use the constant pragma.

_____________________________________________________________________
Stas Bekman              JAm_pH     --   Just Another mod_perl Hacker
http://stason.org/       mod_perl Guide  http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://logilune.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/


Reply via email to