#!/usr/bin/perl &print_HTTP_header ; &print_head ; &print_body ; &print_tail ; # print the HTTP Content-type header sub print_HTTP_header { print "Content-type: text/html\n\n" ; } #Print the start of the HTML file sub print_head { print < CGI Environment Variables

Environment Variables


END } #Loop through the environment variable #associative array and print out its values. sub print_body { foreach $variable (sort keys %ENV) { print "$variable: $ENV($variable)
\n"; } } #Print the close of the HTML file sub print_tail { print < END }