#!/usr/local/bin/perl
use CGI; 
use CGI::Carp "fatalsToBrowser"; 
my $cgi = new CGI; 
print "Content-type: text/html\n\n"; 
print "<html><body>\n"; 
#print "<h1>Environment Variables</h1>\n"; 
#print "<ol>\n"; 
#while (($key,$value) = each %ENV) { 
#   print "<LI>$key is $value</LI>\n"; 
#} 
#print "</ol>\n"; 

print "<h1>Decoded CGI attributes</h1>\n"; 
print "<OL>\n"; 
foreach $thing ($cgi->param) { 

    print "<li> <font color=\"green\">$thing</font> has value <font color=\"red\">" . &escape($cgi->param($thing)) . "</font></li>\n"; 
} 
print "</OL>\n"; 
print "</body></html>\n"; 
exit 0; 

sub escape { 
   my $thing = shift; 
   $thing =~ s/&/\&amp;/g; 
   $thing =~ s/\"/\&quot;/g; 
   $thing =~ s/</\&lt;/g; 
   $thing =~ s/>/\&gt;/g; 
   return $thing; 
} 
