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

[MacPerl] Demo.acgi and %ENV



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:

foreach $envkey (keys %ENV) {
        printf("%-20s %s\n", $envkey, $ENV{"envkey"});
}

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 with MacPerl513.

My apologies if I'm missing the obvious.