You'll only get stuff like that if you have the webserver run it. Your post seemed to imply that you ran it from the command line which shouldn't have stuff like QUERY_STRING.
I put the following script in my cgi-bin directory on my webserver:
#!/usr/bin/perl
print("Content-type: text/html\n\n");
foreach (keys %ENV) {
print $_ . "==>" . $ENV{$_} . "<BR>";
}
I then pointed my brower to the URL and here's the output:
SCRIPT_NAME==>/~xorl/cgi-bin/test.pl
SERVER_NAME==>devel.intranet
SERVER_ADMIN==>xorl@mydomain.org.net.com
HTTP_ACCEPT_ENCODING==>gzip,deflate
HTTP_CONNECTION==>keep-alive
REQUEST_METHOD==>GET
HTTP_ACCEPT==>text/xml,application/xml,application/xhtml+xml,text/html
+;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
SCRIPT_FILENAME==>/export/home/xorl/public_html/cgi-bin/test.pl
SERVER_SOFTWARE==>Apache/2.0.52 (Red Hat)
HTTP_ACCEPT_CHARSET==>ISO-8859-1,utf-8;q=0.7,*;q=0.7
QUERY_STRING==>
REMOTE_PORT==>41051
HTTP_USER_AGENT==>Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.13) G
+ecko/20060413 Red Hat/1.7.13-1.4.1
SERVER_PORT==>80
SERVER_SIGNATURE==>
Apache/2.0.52 (Red Hat) Server at uit183.ntdp.intranet Port 80
HTTP_ACCEPT_LANGUAGE==>en-us,en;q=0.5
HTTP_COOKIE==>TZ=America%2FChicago; session_id=2d7fb6ee9da78c293d33620
+0de6f0219; authusername7=admin; authpassword7=06aed384ecae502cac7ae47
+c7597ffe6
REMOTE_ADDR==>10.33.1.32
HTTP_KEEP_ALIVE==>300
SERVER_PROTOCOL==>HTTP/1.1
PATH==>/usr/local/bin:/usr/bin:/bin
REQUEST_URI==>/~xorl/cgi-bin/test.pl
GATEWAY_INTERFACE==>CGI/1.1
SERVER_ADDR==>10.33.1.32
DOCUMENT_ROOT==>/export/htdocs
HTTP_HOST==>uit183.ntdp.intranet
UNIQUE_ID==>2e-u6gohASAAAE8d0SIAAAAA
Try running the script that way and see what you get then.
|