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

Re: [MacPerl] CGI problems (%ENV scrambled!)



On 12/22/97, Paul Schinder wrote:
>Have you tried a simple non-cgi script that loads up %ENV and then
>prints it right back out?  It strikes me that the four that work are
>all predefined.  Maybe the something screwy going on has nothing to do
>with CGI's at all.

Well, if I run my little CGI program in the MacPerl application -- with no
Web server involved -- this is what I get in the output window:

	Content-type: text/html

	$ENV{'TMPDIR'}: Quadzilla:Temporary Items:<BR>
	$ENV{'MACPERL'}: G3:MacPerl:<BR>
	$ENV{'PERL5LIB'}: G3:MacPerl:lib,G3:MacPerl:lib2<BR>
	$ENV{'USER'}: Adam<BR>

In other words, exactly what you'd expect.  I find it interesting that in the
mixed-up CGI version, these non-CGI $ENV variables are scattered throughout
the jumbled hash, but the keys do remain with the appropriate values.

Here's another piece of weirdness: if I run my CGI through the server with a
variable in the URL, like so: http://127.0.0.1/env.cgi?textvar=abc -- the
output is slightly different, but includes a few more strange pairs,
including:

$ENV{'testvar'}: abc=REMOTE_ADDR

If I'm not mistaken, there SHOULD be an $ENV variable that says something
like "$ENV{'QUERY_STRING'}: testvar=abc", correct?  So somewhere along the
line, even the query string is getting chopped up wrong.


Adam



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch