What Environmental Variables are Available
In PERL, to view all Environmental Variables type:
foreach $ev(keys %ENV) {
print "$ev - $ENV{$ev}<br>";
}
The Environmental Variables names will be in all caps on the left while their value is on the right.
To access any of these Environmental Variables anytime, just type $ENV{'VAR_NAME'} where VAR_NAME is the name of the Environmental Variable:
Example:
For the query string:
$ENV{'QUERY_STRING'}
For the user's IP address:
$ENV{'REMOTE_ADDR'}
Copy and Paste Perl Code:
#!/usr/bin/perl
print "Content-type:text/html\n\n";
foreach $ev(keys %ENV) {
print "$ev - $ENV{$ev}<br>";
}
exit;