| | |
CGI, Tomcat, Perl, not compiling Perl code?
Please support our Perl advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jul 2007
Posts: 2
Reputation:
Solved Threads: 0
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)..
...and the simple Perl code ...
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''''''''''''
I have this simple page (taken from a tutorial)..
Perl Syntax (Toggle Plain Text)
<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 ...
Perl Syntax (Toggle Plain Text)
#! C:\Perl\bin\perl.exe "Content-type: text/plain\n\n"; foreach $var ( sort keys %ENV) { "$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''''''''''''
I understand that you say you have setup Tomcat to run CGI scripts, but it appears you did not set it up correctly. Since this is really a Tomcat configuration issues maybe asking on a Tomcat forum will get you the info you need.
Does Tomcat use the ubiquitous cgi-bin? Are your scripts in the cgi-bin? Have you tried .cgi and .pl?
Does Tomcat use the ubiquitous cgi-bin? Are your scripts in the cgi-bin? Have you tried .cgi and .pl?
![]() |
Similar Threads
- Basic Perl Web Upload Script (Perl)
- running Perl/CGI scripts under Tomcat server (Perl)
- Compiling Source Code? (Assembly)
- Serving up html using cgi-perl (HTML and CSS)
Other Threads in the Perl Forum
- Previous Thread: Help specifying dynamic lib path
- Next Thread: How to open HTML page in a browser with specific options selected in drop-down boxes?
| Thread Tools | Search this Thread |
Tag cloud for Perl





