use CGI qw(:all);
print header,start_html;
env_test();
print end_html;
exit(0);
sub env_test {
print h2('Base Account (shell) Environment');
print table(
map { Tr(td($_),td($ENV{$_})) } sort keys %ENV
);
print p(b('CGI Runs As:'),`id`);
print p(b('Current working directory is:'),`pwd`);
print p("I was invoked as: ",$0);
if ($ENV{HOME}) {
if (-d $ENV{HOME} . '/cgi-bin') {
print p('Found the cgi-bin directory in ', $ENV{HOME} . "/cgi-bin");
} else {
print p("I have no clue where the cgi-bin is physically");
}
} else {
print p(b('OH DRAT!'),'The $HOME variable is not being set!');
}
}