It's possibly worth mentioning (should you ever wish to transfer to a
different machine) that not all of these variables have the same name under
all web servers on all platforms.
Some web servers hide system environment variables from cgi scripts for
security reasons.
Some web servers prefix the settings which don't start 'HTTP_' with 'WWW_'.
OT:-
I've also found a curious problem with MS webserver - it changes the request
method from POST to GET and ignores anything after the ? in the FORM ACTION
attribute.
eg:
<FORM METHOD='POST' ACTION='/cgi/myscript?arg1=37'>
I get from IIS:
CONTENT_LENGTH = 0
REQUEST_METHOD = GET
QUERY_STRING = [everything from the form, without 'arg1=37' ]
It's possibly the result of bad practice to infer that such actions will be
processed correctly, but it did catch us out for a while.
Regards,
Tim
----- Original Message -----
From: "David Hempy" <[EMAIL PROTECTED]>
To: "Kan, Yu-Ting" <[EMAIL PROTECTED]>; "ActivePerl"
<[EMAIL PROTECTED]>
Sent: Tuesday, May 22, 2001 9:36 AM
Subject: Re: Perl ENV variable
> At 04:40 PM 5/22/2001 +0800, Kan, Yu-Ting wrote:
> >Dear all,
> >I found that there are a lot environment variable called by perl
> >like $ENV{'REQUEST_METHOD'} and $ENV{'CONTENT_LENGTH'}
> >
> >I need that for writing cgi programs in perl. How and where can I find
all
> >of them?
> >
> >Thanks a lot
> >
> >regards
> >Kan
> >_______________________________________________
>
>
> Copy the following to a file (such as /cgi-bin/env.pl ) and hit it from
your browser. It will show you all the values available to you.
>
> -dave
>
>
> print "Content-type: text/html\n\n<font
size=+3>$ENV{GATEWAY_INTERFACE}</font>
> <table border=1 cellpadding=2 cellspacing=0>\n";
>
> foreach $var (sort keys %ENV) {
> print "<tr><td>\$ENV{<b>$var</b>}
</td><td>$ENV{$var}</td></tr>\n";
> }
>
> print "</table>\n";
>
> print "Also of note:<p>
> <li> \$0 is $0
> <li> time is " . (time) . "
> <li> time is " . (scalar localtime) ."
> <p>";
>
>
>
>
> --
> David Hempy
> Internet Database Administrator
> Kentucky Educational Television - Distance Learning Division
> <[EMAIL PROTECTED]> -- (859)258-7164 -- (800)333-9764
>
>
> _______________________________________________
> ActivePerl mailing list
> [EMAIL PROTECTED]
> http://listserv.ActiveState.com/mailman/listinfo/activeperl
>
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activeperl