Problem: With the $ENV{'blah'} variable 
Author Message
 Problem: With the $ENV{'blah'} variable

I just installed a Windows Apache server and am having problems with
perl CGI programing.  Programs that are simple such as print "Hello";
run just fine.  Programs, however, that require ENV variables are not
working...

recently I tried the following:

#!perl.exe
print "\n";
while (($key,$value) = each %ENV) {
   print "$key=$value\n";

Quote:
}

   but I did not recieve any output.  This leads me to conclude that for

some reason my apache web server is not creating any enviromental
variables before calling perl.exe.  Is this correct???  (i'm not a great

perl programer so I'm not sure if my source code is correct.)

Thanks for your time,
   David wasserstrum



Wed, 22 Nov 2000 03:00:00 GMT  
 Problem: With the $ENV{'blah'} variable

On Sat, 06 Jun 1998 15:30:24 -0400, David Wasserstrum wrote :

Quote:
>I just installed a Windows Apache server and am having problems with
>perl CGI programing.  Programs that are simple such as print "Hello";
>run just fine.  Programs, however, that require ENV variables are not
>working...

Eh,oh

Quote:
>recently I tried the following:

>#!perl.exe
>print "\n";
>while (($key,$value) = each %ENV) {
>   print "$key=$value\n";
>}

>   but I did not recieve any output.  This leads me to conclude that for

Of course you deliberately omiitted the :

print "Content-type:  text/html\n\n";

didnt you ?

Quote:
>some reason my apache web server is not creating any enviromental
>variables before calling perl.exe.  Is this correct???  (i'm not a great

Of course there is wealth of fine documentation available to you
regarding the module CGI.pm and there is also a vast  wealth of
documentation regarding CGI in particular and so and and so forth...

Quote:
>perl programer so I'm not sure if my source code is correct.)

>Thanks for your time,
>   David wasserstrum

No problem

/J\
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>



Wed, 22 Nov 2000 03:00:00 GMT  
 Problem: With the $ENV{'blah'} variable

[ posted and mailed ]

-> #!perl.exe
-> print "\n";
-> while (($key,$value) = each %ENV) {
->    print "$key=$value\n";
-> }
->
->    but I did not recieve any output.  This leads me to conclude that for

Does it work from the command line?

Does the line:  ``print "Content-type: text/html\n\n" ''       look familiar?

If this is the solution to your problem you should be ashamed of yourself for
not doing any research before post to c.l.p.m.

Bob Trieger

" Cost a spammer some cash: Call 1-800-239-0341
    and hang up when the recording starts. "



Wed, 22 Nov 2000 03:00:00 GMT  
 Problem: With the $ENV{'blah'} variable

as you suggested I tried calling my CGI from the command line and it returned
with the correct output (that being all my environmental settings.)  It
still, however, does not work from my web server.  I have this odd feeling
that my Windows Apache server is not setting the environmental variables
before calling perl.exe.  I'm not quite sure how to fix that though...

Quote:

> On Sat, 06 Jun 1998 15:30:24 -0400, David Wasserstrum wrote :

> >I just installed a Windows Apache server and am having problems with
> >perl CGI programing.  Programs that are simple such as print "Hello";
> >run just fine.  Programs, however, that require ENV variables are not
> >working...

> Eh,oh

> >recently I tried the following:

> >#!perl.exe
> >print "\n";
> >while (($key,$value) = each %ENV) {
> >   print "$key=$value\n";
> >}

> >   but I did not recieve any output.  This leads me to conclude that for

> Of course you deliberately omiitted the :

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

> didnt you ?

> >some reason my apache web server is not creating any enviromental
> >variables before calling perl.exe.  Is this correct???  (i'm not a great

> Of course there is wealth of fine documentation available to you
> regarding the module CGI.pm and there is also a vast  wealth of
> documentation regarding CGI in particular and so and and so forth...

> >perl programer so I'm not sure if my source code is correct.)

> >Thanks for your time,
> >   David wasserstrum

> No problem

> /J\
> Jonathan Stowe
> Some of your questions answered:
> <URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>



Wed, 22 Nov 2000 03:00:00 GMT  
 Problem: With the $ENV{'blah'} variable

It turns out that there is a known bug with the version of the Apache web
server that I was using that causes perl.exe to be called without any
environmental settings.  This problem is supposed to be fixed in the next
release.

I just wanted to thank you for your time and help...



Thu, 23 Nov 2000 03:00:00 GMT  
 Problem: With the $ENV{'blah'} variable

Quote:

> I have this odd feeling that my Windows Apache server is not setting the
> environmental variables before calling perl.exe.  I'm not quite sure how
> to fix that though...

But, of course, the problem has now passed beyond the realm of Perl; if
your server isn't doing what it's supposed to, that's a server problem.
In this case, you may be able to fix it by installing Linux, though. :-)

Good luck!

--
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



Fri, 24 Nov 2000 03:00:00 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. Sending Enviroment Variables with LWP ($ENV{'*'})

2. Saving variable in $ENV{'REMOTE_USER'}

3. ENV{'REMOTE_USER'} problem

4. $ENV{'REMOTE_HOST'} Problem on NT

5. Why can't I set env variable in Perl (NT)

6. ??? local(blah blah blah) = @_;

7. $ENV{'AUTH_TYPE'} and $ENV{'REMOTE_USER'}

8. Problems with env: can't use -w or -T

9. $ENV{'QUERY_STRING"} problem

10. NT Perl5 $Env('PATH]) Problem

11. IP address incorrect by $ENV{'REMOTE_ADDR'}

 

 
Powered by phpBB® Forum Software