[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Demo.acgi and %ENV



beck@becktek.com (BeckTek Info)
>I'm mystified about the %ENV hash used with the CGI Glue for the following
>reason:
>
>If I code:
>
>printf ("The number of env variables is %d\n", scalar (keys %ENV));
>and do a foreach loop to inspect:
[...]
>it only shows at most one variable, a supplied QUERY STRING.
>
>However, if I insert debugging code to explicitly examine variables above
>this loop, like
>
>printf ("SERVER SOFTWARE %s\n", $ENV{"SERVER_SOFTWARE"});
>
>I get the "correct" output from these printfs AND the foreach loop
>for whatever variables I explicitly examine. It appears that the act of
>examining these hash element caused them to spring to life with their
>correct values.

This is precisely what happens and is a bug in UN*X perl 5.002. This will
work correct again in 5.004; I decided aginst fixing it locally.

Matthias

-----
Matthias Neeracher   <neeri@iis.ee.ethz.ch>   http://www.iis.ee.ethz.ch/~neeri
  "If all goes well, you should see a 'Happy Mac' then your computer will
   just freeze. If this happens, then our boot code works!"
                                                  -- OpenOS Boot Image