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

[MacPerl] question about %ENV



I know that all the %ENV is not available in MacPerl, however, I was
wondering how to tell just what portions are. Reading the docs is ok, but
when programs change, docs usually do not keep up with the changes.

On my Unix-based site, running

version 5.003 with EMBED
        built under irix at Sep 28 1996 18:40:15

I can run a scipt fragment like this:

======================================================
foreach ( sort keys %ENV ) {
	print "$_ = $ENV{$_}<BR>\n";
}
======================================================

and get a listing like this:

======================================================
AUTH_TYPE = Basic
DOCUMENT_ROOT = [snip]
GATEWAY_INTERFACE = CGI/1.1
HTTP_ACCEPT = image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
HTTP_ACCEPT_LANGUAGE = fr-CA, en, fr-FR, fr
HTTP_CONNECTION = Keep-Alive
HTTP_COOKIE = Apache=dante1587875288248122
HTTP_HOST = [snip]
HTTP_USER_AGENT = Mozilla/3.01-C-MACOS8 (Macintosh; I; PPC)
INFORMIXDIR = /usr/people/informix/
INFORMIXSERVER = lorax
LD_LIBRARY_PATH = :/usr/people/informix/lib/tools/
PATH = [snip]
PWD = [snip]
QUERY_STRING =
REMOTE_ADDR = [snip]
REMOTE_HOST = [snip]
REMOTE_USER = donls
REQUEST_METHOD = GET
SCRIPT_FILENAME = [snip]
SCRIPT_NAME = [snip]
SERVER_ADMIN = help@cpicorp.com
SERVER_NAME = www.cpicorp.com
SERVER_PORT = 80
SERVER_PROTOCOL = HTTP/1.0
SERVER_SOFTWARE = Apache/1.1.1
TZ = CST6CDT
======================================================

which enumerates all (my own delusion, based on perl docs) the %ENV
contents. When I run it on MacPerl 5.13r2 [I have added some explicit
references to links I think should be there]:

======================================================
print "Values from ENV:<br>$eol";

foreach ( keys %ENV ) {
	print "$_ = $ENV{$_}<BR>\n";
}

print "DOCROOT is $ENV{'DOCUMENT_ROOT'}<br>$eol";
print "Languages are $ENV{'HTTP_ACCEPT_LANGUAGE'}<br>$eol";
print "Host is $ENV{'HTTP_HOST'}<br>$eol";
print "Server Software is $ENV{'SERVER_SOFTWARE'}<br>$eol";

print "End of script<br>$eol";
======================================================

This is all I get:

======================================================
Values from ENV:
REQUEST_METHOD = GET
DOCROOT is
Languages are fr-CA, en, fr-FR, fr
Host is localhost
Server Software is MacHTTP/2.0
End of script
======================================================

Note that the only key/val pair returned is $ENV{'REQUEST_METHOD'}, even
though these other key/val pairs apparently exist, and DOCUMENT_ROOT
doesn't! If this listing method worked, I could tell if there was an
alternate name, as sometimes happens with different server/client sets.

I like systems where I can write a script that produces self-documentation.
Perl normally fits that profile exceptionally well.

BTW, this performs the exact function as the free responder.cgi, whose
source is available to all with no restrictions. Does anyone know where
that source is, what language it is in? I couldn't find any details I could
interpret from the file that was included with personal web sharing, and no
links to places that would have more detail. Not what I'm used to!!!



Don Ellis
mailto://donls@michelob.wustl.edu
http://www.sluug.org/~donls
http://www.searsportrait.com



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