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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

The specified CGI application misbehaved????Invalid argument

Status
Not open for further replies.

oceans11

MIS
Apr 15, 2003
17
US
Hello,
I get this full error:
The specified CGI application misbehaved by not returning a complete set of HTTP headers:c:\inetpub\ line 263.

This is for a test Message Board I am working on(Intranet Site for work!)I am running on XP PRO IIS 5.1 with ActiveState Perl installed.

Here's where i think the problem might be:
# Define Variables
$basedir = "c:\inetpub\$baseurl = "$cgi_url = "
Any idea's? I am new to this so any help would be great!

Thanks!

OCEANS11
 
CGI scripts need to print out headers so the browser knows what type of file it's receiving (text/html, image/gif, etc).

For instance:
Code:
#!/usr/bin/perl -w

print "Content-Type: text/html\n\n";
print "hello world!";

Without printing the Content-Type, your server would give you that error.

So your error is probably not caused by setting those variables, it's probably caused by not printing HTTP headers.

-------------
Kirsle.net | Kirsle's Programs and Projects
 
Also:

Code:
$basedir = "c:\inetpub\wwwroot\cgi-bin\wwwboard.pl";

The backslashes there will cause problems. Either single quote that variable or (more recommended) just use forward slashes.

Code:
$basedir = "c:/inetpub/wwwroot/cgi-bin/wwwboard.pl";

-------------
Kirsle.net | Kirsle's Programs and Projects
 
Also, wouldn't basedir be looking for a directory and not the full path to the script?

- George
 
Hello,

I changed the backslahes to forward slashes and now the error reads No such file or directory line 236.

Here's the line:

# New File Subroutine

sub new_file {

open(NEWFILE,">$basedir/$mesgdir/$num\.$ext") || die $!;

Any other idea's!

Thanks!

Oceans11

 
>> Any other idea's!

Yes, use a valid path to the directory you want to use. Make sure the directory has read permission or any other permission the script may require.

is $mesgdir and $num and $ext all defined properly? Print it out as the script runs to see if so:

print "$basedir/$mesgdir/$num.$ext";

you don't need to escape the . in a double quoted string.

- Kevin, perl coder unexceptional!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top