printenv revision 4fbc88f2e30e514f0bf0a72e80bfb439de26cd6b
abbedb998850d9950bc5f5907ca2f6437b0a936ewrowe#
abbedb998850d9950bc5f5907ca2f6437b0a936ewrowe
abbedb998850d9950bc5f5907ca2f6437b0a936ewrowe# To permit this cgi, replace # on the first line above with the
4fbc88f2e30e514f0bf0a72e80bfb439de26cd6bfuankg# appropriate #!/path/to/perl shebang, and on Unix / Linux also
4fbc88f2e30e514f0bf0a72e80bfb439de26cd6bfuankg# set this script executable with chmod 755.
abbedb998850d9950bc5f5907ca2f6437b0a936ewrowe#
abbedb998850d9950bc5f5907ca2f6437b0a936ewrowe# Note that it is subject to cross site scripting attacks on MS IE
abbedb998850d9950bc5f5907ca2f6437b0a936ewrowe# and any other browser which fails to honor RFC2616, so never use
abbedb998850d9950bc5f5907ca2f6437b0a936ewrowe# it in a live server environment, it is provided only for testing.
abbedb998850d9950bc5f5907ca2f6437b0a936ewrowe
1dcd0b672e2e3edd4cce2024ff197a8a18f3816afielding##
1dcd0b672e2e3edd4cce2024ff197a8a18f3816afielding## printenv -- demo CGI program which just prints its environment
1dcd0b672e2e3edd4cce2024ff197a8a18f3816afielding##
bc3cb71096f96bbb3935de7b72c73cc3b02be666rbowenuse strict;
bc3cb71096f96bbb3935de7b72c73cc3b02be666rbowenuse warnings;
f3220f54126b25e1cf93cc26c17177b7aef850fdfielding
d465130a2383063c73545375b4444bcef3cf30f6fieldingprint "Content-type: text/plain; charset=iso-8859-1\n\n";
bc3cb71096f96bbb3935de7b72c73cc3b02be666rbowenforeach my $var (sort(keys(%ENV))) {
bc3cb71096f96bbb3935de7b72c73cc3b02be666rbowen my $val = $ENV{$var};
1dcd0b672e2e3edd4cce2024ff197a8a18f3816afielding $val =~ s|\n|\\n|g;
1dcd0b672e2e3edd4cce2024ff197a8a18f3816afielding $val =~ s|"|\\"|g;
1dcd0b672e2e3edd4cce2024ff197a8a18f3816afielding print "${var}=\"${val}\"\n";
f3220f54126b25e1cf93cc26c17177b7aef850fdfielding}
f3220f54126b25e1cf93cc26c17177b7aef850fdfielding