[sf-perl] use lib and @INC

Peter Loo loopeter at yahoo.com
Tue Oct 6 14:00:16 PDT 2009

Hello All,
I don't know if this is Perl configuration or Apache, but I am having a problem with Perl module loading during execution of a CGI program.
Here is what I did at the beginning of the CGI program.
  use DBI;
  use warnings;
  use CGI qw(-tabindex :standard Vars);
  use CGI::Carp qw(fatalsToBrowser carpout);
  use File::Basename;
  use Date::Calc qw(:all);
  use lib '/rms/awa/imy/sh';
  use lib '/rms/awa/common/sh';
  require "local_vars.pm";
  require "global_routines.pm";
When the program is called in the browser, I get the following error message:
Software error:Can't locate local_vars.pm in @INC (@INC contains: /rms/awa/common/sh /rms/awa/imy/sh /usr/local/lib/perl5/5.8.8/sun4-solaris /usr/local/lib/perl5/5.8.8 /usr/local/lib/perl5/site_perl/5.8.8/sun4-solaris /usr/local/lib/perl5/site_perl/5.8.8 /usr/local/lib/perl5/site_perl/5.8.7/sun4-solaris /usr/local/lib/perl5/site_perl/5.8.7 /usr/local/lib/perl5/site_perl .) at /var/apache/cgi-bin/rms/login.cgi line 23.

This local_vars.pm is located in /rms/awa/imy/sh.  And as you can see that /rms/awa/imy/sh is in fact in @INC.
The funny thing though is that when I place the local_vars.pm in /var/apache/htdocs/rms/lib, the program locates the file and all is good.
I was wondering if anyone would know what I am missing here.
The version of Apache is 1.3.26 and Perl is 5.8.8.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/sanfrancisco-pm/attachments/20091006/61e4ff5c/attachment.html>

More information about the SanFrancisco-pm mailing list