#!/usr/local/bin/perl # This script returns all of the values in a particular # server's Environment array at the time of execution. # -- Comments by The Starman (July 1999; March 2001). # http://www.geocities.com/thestarman3/perl/perl2.html # # Program Subroutines for printing the HTML(Output) page: &print_HTTP_header; &print_head; &print_body; &print_foot; exit; # ====================================================== # print the HTTP Content-type header sub print_HTTP_header { print "Content-type: text/html\n\n"; } # ====================================================== # Print the usual HTML template tags and Name the page sub print_head { print < Environment Variables


Server Environment Variables:

END ; } # ================================================================ # Loop through all the environment variables contained in the # Server's Associative Array and print out their values. # (Uses perl sort function to place all the variables in # alphabetical order on the output page.) sub print_body { foreach $variable (sort keys %ENV) { print "$variable: $ENV{$variable}
\n"; } } # ================================= # Finish the HTML document (Footer) sub print_foot { print < END ; }