Apache and Perl in Windows
- From: Arn Anderson <AA@xxxxxx>
- Date: 23 Dec 2005 19:29:35 GMT
Hi and Merry Christmas. I am having a problem. The cgi scripts execute,
but the output is empty. I am studying a spider book that uses Perl so I
download perl and Apache, then uncomment out the lines in the web.xml
file in apache and rename the jar files in the server directory. Then I
launch apache and run my script using an HTML file. The script executes,
but I don't see any results. Perl works fine separately and so does
Apache. But together, they don't. Here is the source code for the 2
files. I think this has to do with permissions, but when I installed
Apache, I used the same account and password as my Windows username and I
am administrator. I am out of ideas. If anyone knows what is going wrong,
I would appreciate the help. Thank you.
<HTML>
<HEAD>
<TITLE>Environment Variables
using GET</TITLE>
</HEAD>
<BODY>
<FORM ACTION="cgi-bin/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>
#!c:\Perl\bin\perl.exe
use CGI qw(:all);
use Strict;
use LPW::Simple;
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";
}
.
- Follow-Ups:
- Re: Apache and Perl in Windows
- From: Arn Anderson
- Re: Apache and Perl in Windows
- From: Brian Wakem
- Re: Apache and Perl in Windows
- Prev by Date: FAQ 9.17 How do I check a valid mail address?
- Next by Date: Eval not reseting
- Previous by thread: FAQ 9.17 How do I check a valid mail address?
- Next by thread: Re: Apache and Perl in Windows
- Index(es):
Relevant Pages
|