http://faculty.mdc.edu/msanche2/cop2990/environment.htmlDamn that is interesting DOS now has environmental variables just like UNIX. When i ran this program on a PC at SCC it worked just like it would in UNIX but it dumped out a bunch of DOS looking variables.
To run the program as a CGI program from this web site click here dumpenv.pl
Here is the program that works on DOS. I still have to convert it to run on UNIX
print "wow I didnt know DOS had ENV variable!!!!";
print "but it does!!!";
print "i ran this program on a DOS PC at SCC and it worked!!!";
#
# look at to see the values you get
#
# http://faculty.mdc.edu/msanche2/cop2990/environment.html
#
#print ($_,$ENV{$_}) foreach (keys %ENV);
#
# dump all the variable in %ENV
#
foreach (keys %ENV) {
#print "hi world\n";
print "\$_='$_'\n";
print "\$ENV{$_}='$ENV{$_}'\n";
#print ($_,$ENV{$_});
#print "\n";
}
Here is the program after i rewrote it to work on this web site
#!/usr/bin/perl
print "Content-type: text/html", "\n\n";
print "<html>\n";
print "<body background=\"nevada.gif\">\n";
print "<h2 align=\"center\">What are your Environmental Variables set to?</h1>\n";
print "<blockquote>";
print "wow I didnt know DOS had ENV variable!!!!";
print "but it does!!!";
print "i ran this program on a DOS PC at SCC and it worked!!!";
print "</blockquote>";
print "These are the $ENV or %ENV or $ENV{$var} variables";
print "<p>";
#
# look at to see the values you get
#
# http://faculty.mdc.edu/msanche2/cop2990/environment.html
#
#print ($_,$ENV{$_}) foreach (keys %ENV);
#
# dump all the variable in %ENV
#
print "<table border=1>";
foreach (keys %ENV) {
print "<tr>";
print "<td>";
#print "\$_='$_'\n";
print "<td>\$ENV{$_}</td>\n";
print "<td>$ENV{$_}</td>\n";
print "</td>";
print "</tr>";
}
print "</table>";