perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Perrin Harkins <per...@elem.com>
Subject Re: Apache::PerlRun weird behavior?
Date Sun, 01 Sep 2002 14:56:24 GMT
valerian wrote:
> So the weird thing is that it runs fine the first time, but when I
> reload the page, it doesn't show the variable I imported from
> My::Config

Try changing this:

use My::Config;

to this:

require My::Config;
import  My::Config;

BEGIN blocks are only run once in PerlRun/Registry, and PerlRun clears 
the current namespace after each request, erasing the aliases created by 
import.  In general, you'd be better off just avoiding aliases and 
Exporter altogether, since they waste memory and can cause confusion.

Of course I can't explain why this worked for Stas.  Maybe there is 
something about the specific versions of Perl/mod_perl that affects this.

- Perrin


Mime
View raw message