in reply to Setting the @INC variable for Apache running on Windows

So, the Perl knows where my *.pm files are. Unfortunately, Apache doesn't know that

Actually, your statement there is not quite correct. It's not Apache that doesn't know where the module is, it is indeed Perl. Perl is the one who placed that error message in the Apache log, so for some reason Perl is confusing itself (or you have confused it). As the error message shows, Perl isn't seeing that c:/Apache/htdocs/mokslas/lib is part of @INC. Can I ask why you have PERLLIB="C:/Apache/htdocs/mokslas/lib" in the output of perl -V? (Read last paragraph for reason of strikeout)

I'm quite curious as to why perl shows the directory as part of @INC within perl -V but why the added directory into @INC isn't being passed into the interpreter. The only way I can understand why this might happen is the following: do you have more than one installation of perl on the machine involved? If, for example, you have both perl 5.6.1 and perl 5.8.0 installed, and you modified the @INC for perl 5.6.1 and your script is loading perl 5.8.0, then perhaps perl versions keep seperate @INCs? The only scenerio that came instantly to mind...

UPDATE, 5 seconds later: I believe the correct environment variable is PERL5LIB, not PERLLIB. Somebody correct me if I am wrong.

UPDATE, several minutes later...: As This external page suggests, it seems that PERLLIB and PERL5LIB are both valid for this use. I'm still perplexed as to why perl is getting confused on your machine. But now I've half-thought of something else. Do you have Mokslas.pm in C:/Apache/htdocs/mokslas/lib or just in C:/Apache/htdocs/mokslas? I'm wondering if perhaps you just imitated the current @INC values by appending the /lib part on... however, that still does not explain the fact that the error logged does not mention the fact that the new directory is there... {still confused}

Last, Final Update: Apparently it truly *IS* Apache that is at fault here. It seems (just learned from PodMaster via the CB) that Apache strips the environment variables on handing execution to Perl. It is for security purposes that this is done. pulls certain environment variables and doesn't even look at the rest of them. Thus Apache only import the environment variables that it is interested in. I really don't know much on the subject, discuss it with PodMaster if you wish to know more (he seems to understand it quite well). Therefore, use the 'use lib' functionality already suggested, or if possible, why not move your custom modules into C:/Perl/Site/Lib/Some/Module?

  • Comment on Re: Setting the @INC variable for Apache running on Windows