0
votes

I am setting up perl site on XAMPP local server. I have placed the code at proper place and change first line of all .pl and .cgi files as per the path. i.e.

#!"D:\xampp\perl\bin\perl.exe"

for my case. Still I am getting error like

Can't locate inc/nph-globals.pl in @INC (@INC contains: D:/xampp/perl/site/lib/ D:/xampp/perl/lib D:/xampp/perl/site/lib . D:/xampp/apache) at D:/xampp/htdocs//cgi-bin/webscripts/nph-home.pl line 9.

Please suggest.

2
Is there such a file anywhere on your system, and if so where?ikegami
yes. nph-globals.pl file is in D:/xampp/htdocs/MYAPPLICATION/cgi-bin/webscripts/inc folder.bhushan

2 Answers

2
votes

I suspect the file is located at

D:/xampp/htdocs/cgi-bin/webscripts/inc/nph-globals.pl

If so, it doesn't work because your script incorrectly assume the current working directory is set to the directory that contains the executing script, namely

D:/xampp/htdocs/cgi-bin/webscripts

The following code will address that issue:

use lib 'D:/xampp/htdocs/cgi-bin/webscripts';

Or generically,

use Cwd            qw( realpath );
use File::Basename qw( dirname );

use lib dirname(realpath($0));
0
votes

Looks to me that on the file that give this error, it cannot locate the file inc/nph-globals.pl. probably in that file, you need to specify something like

#!"D:\xampp\perl\bin\perl.exe" -I <path_to_inc_nph-globals.pl>