#!/usr/bin/perl
use CGI;
$q = CGI->new();
print $q->header();
foreach $key (sort keys(%ENV)) {
print "$key = $ENV{$key}<p>";
}
1;
You should close the handle for INF after the @data = <INF>; line.
Before you put yourself through hours of re-writing scripting, you may find that the environmental variable your looking for is named something else, or may not be turned on in the config file for the server.
The Admin for the server should know.
I have been through changing over to new servers in the past and un-wisely spent hours beating my head against the keyboard trying to trouble shoot a script only to find out that the new server didn't provide all the same environmental variables.
By running the script provided, or something similar, you might be able to save yourself a few bruises.
If the server is a shared hosting situation, the tech support should be able to turn on the variable for you, or may tell you to over-ride it in your own .htaccess file.
If you need to do the latter, head over to This site or This site and learn all of the wonderful things you can do to control your hosted space with .htaccess
It will save you hours of time in coding, and give you a better understanding of how to control and secure/protect your website from unwanted guest, and to better use the server resources to enhance your scripting.
Best of Luck to you |