Loading perl modules from same directory

2003-08-27 Thread js
All,

I'm having problems loading .PM modules (apache2, mod_perl2) that are in the
root directory and am not quite sure where to begin (Been here
http://perl.apache.org/docs/general/perl_reference/perl_reference.html#The__INC_hash
but no success).

I am converting code from an IIS/Perl CGI implementation and the following
worked before without any problems.

In the WWWROOT, I had mylib.pm (example) and in a perl script I simply
said: use mylib;

In mod_perl 2.0, using COMPAT etc, I get: ModPerl::Registry: Can't locate
mylib.pm in @INC (@INC cont
ains: C:/Perl/site/lib/Apache2 C:/Perl/lib C:/Perl/site/lib . C:/apache2/
C:/apache2/lib/perl) at C:/apache2/htdocs/ptest.pl line 2.
BEGIN failed--compilation aborted at C:/apache2/htdocs/ptest.pl line 2.


My question is, why isn't Apache2/Mod_perl finding the library to load, if
the PM file is in the same directory as the perl-script?  Is this a sandbox
security feature?  I know its a bad idea, but its legacy code and is
peppered everywhere.

JS





-- 
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html



Re: Loading perl modules from same directory

2003-08-27 Thread Perrin Harkins
On Wed, 2003-08-27 at 14:48, js wrote:
 My question is, why isn't Apache2/Mod_perl finding the library to load, if
 the PM file is in the same directory as the perl-script?

This is a mod_perl 2 issue, which is documented here:
http://perl.apache.org/docs/2.0/user/porting/compat.html#C_Apache__Registry___C_Apache__PerlRun__and_Friends

There is a workaround for it on that page as well.

- Perrin


-- 
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html