You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by pe...@swanmail.com on 2003/09/30 08:19:17 UTC

Can't locate module.pm file

I have a problem calling a module in my mod_perl dir using apache on
redhat 9. I have a mystuff.pm in the same directory as the calling perl
program. I got it working running on the command line but in apache
mod_perl, it can't find the module.

Questions:
 - Where should the mystuff.pm be located in?
 - The only place i know about mod_perl configuration file is:
/etc/httpd/conf.d/perl.conf. This contains the Alias and Directory
directive.

Error message:
Can't locate mystuff.pm in @INC (@INC contains:
/usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl
/usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 .)

Any help would be great.
By the way, I just getting started with perl.
-rkl

Re: Can't locate module.pm file

Posted by Thomas Schindl <to...@profile.co.at>.
This is once more a question where you should have looked once more at
the documention at perl.apache.org.

When you execute your perl programm on the commandline you automatically
have "." in your @INC == include path.

Mod_perl is not executed in the directory where your .pm is located, so
you have to add it to your path manually.

See also:
http://perl.apache.org/docs/1.0/guide/config.html#The_Startup_File

I advice you to learn how @INC is working in normal perl, and consulting
the mod_perl docu afterwards then you can solve this problem yourself.

One more advice read the error-message below once more. It tells you
everything you need to solve the problem("Where should I ... ") when you
know how @INC is working.

Tom


On Tue, 2003-09-30 at 08:19, perl@swanmail.com wrote:
> I have a problem calling a module in my mod_perl dir using apache on
> redhat 9. I have a mystuff.pm in the same directory as the calling perl
> program. I got it working running on the command line but in apache
> mod_perl, it can't find the module.
> 
> Questions:
>  - Where should the mystuff.pm be located in?
>  - The only place i know about mod_perl configuration file is:
> /etc/httpd/conf.d/perl.conf. This contains the Alias and Directory
> directive.
> 
> Error message:
> Can't locate mystuff.pm in @INC (@INC contains:
> /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0
> /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi
> /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl
> /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi
> /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl
> /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 .)
> 
> Any help would be great.
> By the way, I just getting started with perl.
> -rkl
-- 
   \\\||///
  \\  - -  //
   (  @ @  )
-oOo--( )--oOo----------------------------------------------------------
                     ___  ___                                tom schindl
      o       __    /  / /           innovative medientechnik planung AG
     / /\/\/ / /   /__/ / __            mailto:tom.schindl@profile.co.at
    / / / / /_/   /  / /___/                        http://www.impire.de
           /                 voice:+43(512)34193432,fax:+43(512)34193420
   Eduard-Bodem-Gasse 6, A-6020 Innsbruck, Austria, Software Engineering
------------------------------------------------------------------------