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

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



On 12/22/97, Chris Nandor wrote:
>One concern of mine is that the output you gave us is not the output of
>your script.  That might be nothing, but it could be part of the problem
>here.  If you have not done so, please use that exact script you posted and
>check the output of it.

Okay, here's my latest test script, verbatim:

	#!perl
	print "Content-type: text/html\n\n";
	foreach (keys %ENV) {
	  print "\$ENV\{\'" , $_ , "\'\}: " , $ENV{$_} , "<BR>\n\n";
	  }

And here's the output in a Web browser:

	$ENV{''}: SERVER_SOFTWARE
	$ENV{'GET'}: SERVER_NAME
	$ENV{'Keep-Alive'}: HTTP_PRAGMA
	$ENV{'MACPERL'}: G3:MacPerl:
	$ENV{'acs.bitstream.net'}: SERVER_PORT
	$ENV{'http://www2.bitstream.net/~acs/adam.html'}: HTTP_USER_AGENT
	$ENV{'80'}: SCRIPT_NAME
	$ENV{'iso-8859-1,*,utf-8'}: HTTP_ACCEPT
	$ENV{'MacHTTP/2.0'}: GATEWAY_INTERFACE
	$ENV{'TMPDIR'}: Quadzilla:Temporary Items:
	$ENV{'CGI/1.1'}: SERVER_PROTOCOL
	$ENV{'en'}: HTTP_ACCEPT_CHARSET
	$ENV{'127.0.0.1'}: REQUEST_METHOD
	$ENV{'Mozilla/4.03 (Macintosh; I; PPC, Nav)'}: HTTP_CONNECTION
	$ENV{'/env.cgi'}: HTTP_REFERER
	$ENV{'no-cache'}: HTTP_HOST
	$ENV{'HTTP/1.0'}: REMOTE_ADDR
	$ENV{'PERL5LIB'}: G3:MacPerl:lib,G3:MacPerl:lib2
	$ENV{'USER'}: Adam

As you can see, MACPERL, PERL5LIB, TMPDIR, and USER are okay.  Everything
else is mixed up.  Asking for the variables by name (e.g. $ENV{'HTTP_HOST'})
doesn't work either.  By the way, this little test script works perfectly on
a UNIX server.

>Anyway, something else to check is the extension you saved this with.
>Please check the name and date of that extension.

It's "CGI Script", created and modified on Jan. 19, 1997.  I'm pretty sure
this is the one that came with MacPerl 5.1.5r4.  And it worked fine before I
got the G3.

Adam



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