Hi,

My webhost allows me to use mod_perl (Apache 2 server by the way, Fedora distro). And I'm glad I can because it speeds up my perl scripts a lot. I've created a website that's based on CGI::Application, Template-Toolkit and DBIx::Class. All works fine. Those modules, including my own, are in a custom lib. Done so with use lib qw(etc etc etc) and just to be sure I've set PERL5LIB. I've been running it under ModPerl::Registry and ModPerl::PerlRun. Both give me the same, infrequent errors.

Modules like Template::Plugins use lazy loading. I load Template::Plugin::Date by default (TT is in my custom lib). The lazy loading happens with a require in an eval block. But somehow, my @INC has been reset when going through that eval() part. Same thing happens with Excel::Template. This modules does the same, but in BEGIN blocks.

My scripts don't die. The eval() parts sometimes fail (because it can't find the modules). But the rest keeps on working. I've tried lots of things and have searched all over internet. But I can't find a solution. I have no access to httpd.conf so I can't set my custom lib at server startup

The problem only happens when a module is loaded in an eval(). Somehow my @INC is getting reset. And I don't want that to happen :-)

I've searched perl.apache.org and searched all over internet to find a solution. But I couldn't find any.

I'm 100% sure it happens in the modules that use lazy loading (eval(require "module.pm")). Somehow @INC gets reset. My errorlog then states it can't find the required module. Weird thing is, it happens infrequently.

Anyone that had a similar problem and found a solution? Thanks in advance :-)

--

Christiaan Kras


Reply via email to