I already configured the Tomcat to run CGI, following some steps from several tutorials, but I do not know what is happening that I cannot run any Perl CGI. The browser just tries to download the code file, it is not showing the compiled output.
I have this simple page (taken from a tutorial)..
<HTML>
<HEAD>
<TITLE>Environment Variables
using GET</TITLE>
</HEAD>
<BODY>
<FORM ACTION="./WEB-INF/cgi/exp.cgi"
METHOD="GET">
Press submit for a list of environment variables. <BR>
First Name: <input type=
"text" name="fname" size=
30><p>
Last Name: <input type="text"
name="lname" size=30><p>
<input type="submit">
</form>
<FORM>
</BODY>
</HTML>
...and the simple Perl code ...
#! C:\Perl\bin\perl.exe
print
"Content-type: text/plain\n\n";
foreach $var (
sort keys %ENV) {
print
"$var=\"$ENV{$var}\"\n";
}
@values = split(
/&/,$ENV{'QUERY_STRING'});
foreach $i (@values) {
($varname, $mydata) = split(
/=/,$i);
print "$varname = $mydata\n";
}
The Java CLASSPATH...
.;C:\Tomcat\server\lib\servlets-ssi.jar;C:\Tomcat\server\lib\servlets-cgi.jar;C:\Tomcat\webapps\ROOT;C:\Tomcat\server\lib\servlet-api.jar;C:\Tomcat\server\lib\jsp-api.jar;C:\Tomcat\server\lib\el-api.jar
PATH...
C:\Perl\site\bin;C:\Perl\bin;C:\Program Files\Java\jdk1.6.0_02\bin
'''''''''''''''Any help is appreciated''''''''''''