G'day Carlos,
I'd be reasonably certain your problem is that the directory 'lib' is not tied to an absolute path.
Note how all the other @INC paths start with /usr/....
I can emulate your problem like this.
Create a directory called ~/tmp/pm_11124087/lib and add this module to it:
$ cat ~/tmp/pm_11124087/lib/XYZ.pm
package XYZ;
1;
In ~/tmp/pm_11124087, create this script:
$ cat ~/tmp/pm_11124087/test_lib.pl
#!/usr/bin/env perl
use strict;
use warnings;
use lib 'lib';
use XYZ;
If I run that script from ~/tmp/pm_11124087, all is good:
$ ./test_lib.pl
$
However, if I go up one directory:
$ cd ..
$ pm_11124087/test_lib.pl
Can't locate XYZ.pm in @INC (you may need to install the XYZ module) (
+@INC contains: lib /home/ken/...
So that's basically your problem reproduced.
I think you were on the right track with FindBin but left off the 'lib' directory.
I can fix my problem like this:
$ cat ~/tmp/pm_11124087/test_lib.pl
#!/usr/bin/env perl
use strict;
use warnings;
use FindBin;
use lib "$FindBin::Bin/lib";
use XYZ;
So the earlier issues go away:
$ ./test_lib.pl
$ cd ..
$ pm_11124087/test_lib.pl
$
I don't know what your directory structure is:
you may need to adjust the path in use lib "$FindBin::Bin/lib"; to suit your setup.
You reported you checked for the existence of 'lib'.
You should also check that conf.cgi is actually in that directory
and that you have appropriate permissions to access both the directory and the file.
Given your initial report included "webmaster",
those permissions may relate to your web server, not your personal permissions;
e.g. user web needs read permission, not just user carlos.
See also: FindBin and lib.
|