Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem with @INC after configuring new server

Status
Not open for further replies.

marc7

Programmer
Oct 4, 2001
35
0
0
US
we have just upgraded from win NT to 2000 and are having trouble with the "require" function in perl. in the past we were able to use this function and not have to explicitly define the path to the included file (it was always in the same directory as the script we were running). having switch to a new machine, we get this error when running scripts using "require":

CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:
Can't locate cgi-lib.pl in @INC (@INC contains: E:/Perl/lib E:/Perl/site/lib .) at E:\Inetpub\scripts\emedia\mail_a_page_form.pl line 4.

all other perl scripts are working fine, just this path problem that is giving us trouble. any help would be appreciated.

 
To add paths to @INC, before the use/require statements add:

use lib qw|./mylibpath|;

where './mylibpath' is one or more paths, relative or absolute, for the interpreter to search for your scripts and modules.

Barbie
Leader of Birmingham Perl Mongers
 
thanks for this. but previously out sever / perl was configured to accept these require statements as is. have there been any changes in require support with PERL recently, or could this be a path or setting issue?
 
Its probably your servers configuration of PERL5LIB. This is an environment variable that can be set in your AUTOEXEC.BAT or the Registry. More recent versions of ActivePerl (I'm assume you're using a Windows Box by the volume specifier) use the Registry whereas older versions use AUTOEXEC.BAT.

The base is to use the known installed directories, but you can add to PERL5LIB so that @INC includes them automatically.

Have a read through this [1] on the ActiveState site, it will explain it a bit better than I have.

[1]


Barbie
Leader of Birmingham Perl Mongers
 
check in this file E:\Inetpub\scripts\emedia\mail_a_page_form.pl if you are using any .pm module.Also, check path at all places in .pm and .pl file.

Good luck

TTMTECH
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top