Re: Apache and Perl in Windows



Arn Anderson wrote:

> 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;


Should be lower case s.


> use LPW::Simple;


I don't believe this module exists, so your code does not compile.


> print "Content-type: text/plain\n\n";


Why use the CGI module and print your own headers?


> foreach $var (sort keys %ENV) {


Global symbol "$var" requires explicit package name at ....


> print "$var=\"$ENV{$var}\"\n";
> }
>
> @values = split(/&/,$ENV{'QUERY_STRING'});


Global symbol "@var" requires explicit package name at ...

There are many more errors. I can't be bothered to point them all out.
Needless to say the code does not compile.


--
Brian Wakem
Email: http://homepage.ntlworld.com/b.wakem/myemail.png
.



Relevant Pages

  • Apache and Perl in Windows
    ... The cgi scripts execute, ... I am studying a spider book that uses Perl so I ... file in apache and rename the jar files in the server directory. ...
    (comp.lang.perl.misc)
  • Re: [Way OT] perl, CGI, and sendmail
    ... >> Been experimenting with CGI, using perl. ... This is the standard format that came with the Debian install of apache ...
    (Debian-User)
  • Re: Help getting Perl/CGI running on OS X localhost with apache
    ... > I am trying to learn about perl and cgi. ... I have apache and php running ... Use a cgi-bin dir *outside* your document root. ...
    (comp.lang.perl.misc)
  • Re: Perl And Apache.
    ... > After UserID/Password authentication on a web page, does Apache store the ... > UserID in an environment variable that a Perl script could use? ... if you are using the CGI module, you have access to any html form ...
    (comp.lang.perl.misc)
  • Re: Server permission problems and SchAgent
    ... > windows, apache, cgi, scheduler, perl. ... > I was using a CGI script in an Apache2/Win2k ...
    (microsoft.public.scripting.vbscript)