#!perl
# Fig. 26.11: environment.pl
# Program to display CGI environment variables
use CGI qw( :standard );

print header;
print <<End_Begin;
<HTML>
   <HEAD>
      <TITLE>Environment Variables...</TITLE>
   </HEAD>
   <BODY TEXT = "BLACK" BGCOLOR = "WHITE">
   <TABLE BORDER = "0" CELLPADDING = "2" CELLSPACING = "0"
    WIDTH = 100%>
End_Begin

foreach $variable ( sort( keys( %ENV ) ) )
{
   print <<End_Row;
   <TR>
   <TD BGCOLOR = "#11BBFF"><STRONG>$variable</STRONG></TD>
   <TD><FONT COLOR = "BLACK" SIZE = "2">$ENV{$variable}
   </FONT></TD>
   </TR>
End_Row
}

print <<End_Finish;
   </TABLE>
   </BODY>
</HTML>
End_Finish
# Must include newline after End_Finish!

########################################################################## 
# (C) Copyright 2001 by Deitel & Associates, Inc. and Prentice Hall.     #
# All Rights Reserved.                                                   #
#                                                                        #
# DISCLAIMER: The authors and publisher of this book have used their     #
# best efforts in preparing the book. These efforts include the          #
# development, research, and testing of the theories and programs        #
# to determine their effectiveness. The authors and publisher make       #
# no warranty of any kind, expressed or implied, with regard to these    #
# programs or to the documentation contained in these books. The authors #
# and publisher shall not be liable in any event for incidental or       #
# consequential damages in connection with, or arising out of, the       #
# furnishing, performance, or use of these programs.                     #
##########################################################################
