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

Reply via email to