Web Hosting Talk







View Full Version : Perl Include Directory


SPaReK
04-19-2002, 05:39 PM
For some reason the DB_File module is not working on one of our servers. If you use a full path like:

use '/usr/local/lib/perl5/5.6.1/i686-linux/DB_File.pm';

it works, but just:

use DB_File;

It does not find DB_File. Is there any config file I can change so that it looks for DB_File.pm in /usr/local/lib/perl5/5.6.1/i686-linux ?

Thanks

SidVicious
04-19-2002, 05:52 PM
You can use the "use lib" statement to add search paths to @INC the format would be:

use lib '/path/to/dir/with/libs';

You can have it load on Apache start by requirng a perl startup script in httpd.conf by using the following Apache directive:

PerlRequire /path/to/startup.pl

I would place the PerlRequire directly after the modules in httpd.conf and place the startup.pl in the same dir as the httpd.conf.

This file should have all of your use lib statements and needs to end with "1" (without the quotes) on the last line. You can also force the loading of specific modules in this file.

priyadi
04-20-2002, 12:40 AM
I would guess that's because Perl are looking for its libraries under the /usr/lib/perl5 directory, and your DB_File is located under /usr/local/lib/perl5. Reinstalling the DB_File under the correct location will fix the problem.

Or, maybe you have two perls installed, one under /usr/bin and the other under /usr/local/bin. And you are executing one under /usr/bin, and thus it looks for files under /usr/lib. Changing the first line (the #!/usr/bin/perl), to /usr/local/bin/perl will fix this. But it is also helps if you only have one instance of perl interpreter.