The first thing you're going to need to do is to set up your Apache on your box. I did this to do some CGI work on my laptop but I opted for using Apache 1.3 instead of 2.0.
There are a lot of good tutorials on line ( Google is your friend ) to help you get it set up.
As far as my shebang line it looks like this: #!c:/perl/bin/perl.exe -T -w
HTH!
Useless trivia: In the 2004 Las Vegas phone book there are approximately 28 pages of ads for massage, but almost 200 for lawyers.
| [reply] |
| [reply] [d/l] |
Windows may, but Apache (or more accurately, mod_cgi), on windows or other wise, reads the shebang line of any CGI script and uses that program to execute.
(Well, on linux it may not actually read the shebang, it may just pass it to the kernel program executing dealy thingy. But on windows it reads the shebang.)
| [reply] |
While Robertn' observation is true (within limits) for running perl scripts from the Windows command line (but note that it's perfectly possible to run
C:/perl foo.cgi too), in the OP's situation, the Apache configuation determines the required file_type_extension for the script... which may be .cgi, .pl or either.
| [reply] |
Thanks all. Now I know what the shebang line should look like! All this information is very helpful! Here is my code. It's a simple enough script. The problem is that when I bring up the script in a browser, I see a brief glimpse of a dos window and then it does nothing. I am not seeing any HTML generated.
#!C:\perl\bin\perl.exe -w
print "Content-type: text/html\n\n";
print "<HTML>\n";
print " <HEAD>\n";
print " <TITLE>CGI Output</TITLE>\n";
print " </HEAD>\n";
print " <BODY>\n";
print " This is a response to your HTTP request \n";
print " </BODY>\n";
print "</HTML>";
| [reply] |
Hi elbee,
I copied and pasted your code and saved it in a file name "cgitest.pl" and ran it as:
http://127.0.0.1/cgitest.pl
On Windows XP, Apache 2.0.53
No problem, the page was displayed.
Did you set up the Apache config file correctly?
| [reply] |
| [reply] |