I am taking a class on Perl and trying to get it working on Windows Server 2003 running IIS6. I am using Visual Interdev as a development environment.
I installed the latest version from ActivePerl. The installation, I believe, went well. Never any issues encountered. So, I created a small test.asp file with the following code:
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
</HEAD>
<BODY>
<form ACTION="scripts/showme.pl" method="Post" id=form1 name=form1>
<input type="submit" value="Button" id="button1" name="button1">
</form>
</BODY>
</HTML>
Then, I created a folder in my project called Scripts. I created a .pl file with the following code and placed it in the Scripts folder.
#!C:\Perl\bin\perl.exe -wT
use strict;
use CGI ':standard';
print "Content-type: text/html\n\n";
print "Show me the money";
When I first ran the test.asp file and clicked the submit button, I was presented with the following error:
The specified CGI application misbehaved by not returning a complete set of HTTP headers.
I found something on the internet that suggested that I change the mappings in IIS to use perlis.dll instead of perl.exe, so I did that. If I now run the test.asp, click the button, the resulting output in the browser is:
Content-type: text/html 'c:\inetpub\wwwroot\weblanguages\scripts\showm
+e.pl' script produced no output
I found something else that suggested that I did not need the first line when using Windows. So I actually removed the first three lines from the .pl file, and when I run it without those three lines, the output is:
Content-type: text/html Show me the money
So here is where I stand. I can not figure out how to get the application to stop printing the "Content-type: text/html" part of the output. I am under the impression this is the line used to interpret what is to be displayed and that the browser should not print this line out.
Does anyone here have any suggestions on where I can go to find a solution to this, or does anyone here already know the solution?
I would be very thankful for any help
2006-01-06 Retitled by jdporter, as per Monastery guidelines