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

Re: [MacPerl] MacHTTP CGI question revisited



Don't do what you did.  Instead, hardcode the variables you want to print:

#!perl -w
$| = 1;
print "Content-type: text/plain", "\n\n";
@ENV = qw(
        HTTP_USER_AGENT
        REMOTE_ADDR
        SERVER_SOFTWARE
        SERVER_PROTOCOL
        GATEWAY_INTERFACE
        REQUEST_METHOD
        SCRIPT_NAME
        SERVER_NAME
        SERVER_PORT
);
foreach $key (sort @ENV) {
        print $key, " = ", $ENV{$key}, "\n";
}
exit (0);
__END__

I believe this is a bug in either MacPerl or the CGI glue, I can't remember
which.  The %ENV hash is not populated properly.

#================================================================
Chris Nandor                                      pudge@pobox.com
PGP Key 1024/B76E72AD                           http://pudge.net/
Keyfingerprint = 08 24 09 0B CE 73 CA 10  1F F7 7F 13 81 80 B6 B6



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