CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Win32 Programming Help:
CGI Error

 



gaylord
stranger

Jul 2, 2001, 3:46 PM

Post #1 of 4 (5374 views)
CGI Error Can't Post

Hello

I am using WIn 2000 server. I have successfully installed perl and I have tested on some scripts.

My problem is that were I have to use the 'require tag' within a script, I am getting the following error :

"
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 newsconfig.cgi in @INC (@INC contains: C:/Perl/lib C:/Perl/site/lib .) at C:\Inetpub\wwwroot\cgi-bin\mn\news.cgi line 14.

"

Even where the files are in the same directory.

This what an extract of my code looks like

"
require "newsconfig.cgi"; #(This is line 14)

"

What am I doing wrong, please help

Gaylord



Jasmine
Administrator

Jul 2, 2001, 4:17 PM

Post #2 of 4 (5373 views)
Re: CGI Error [In reply to] Can't Post

Try using :


Code
require 'C:\Inetpub\wwwroot\cgi-bin\mn\newsconfig.cgi'; #(This is line 14)




yapp
User

Oct 3, 2001, 2:26 AM

Post #3 of 4 (5329 views)
Re: CGI Error [In reply to] Can't Post

He, this works aswell. (got it from the YaBB forum code)
After this code, your original code should work perfectly.


Code
BEGIN 
{
$THIS_PATH = 'path';
if($ENV{'SERVER_SOFTWARE'} =~ /IIS/)
{
push @INC, $THIS_PATH;
chdir($THIS_PATH);
}
}



The current directory in IIS appears to be the WWW-root all the time. I found that out when using the Cwd module. The $THIS_PATH could also be determinied by examining $0. Do this the way you like, either with a regexp, or with substr() and index().

This helped me out of much trouble in IIS, and makes the script platform-independant.



Cure
User

Nov 29, 2002, 10:21 AM

Post #4 of 4 (4521 views)
Re: [gaylord] CGI Error [In reply to] Can't Post

perldoc require

perldoc lib





Cure

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives