Neither of these fix problems with less-thans or greater-thans or ampersands
in the environment (not "environmental") variables. So, either dump them
as text/plain:
#!/bin/sh
echo content-type: text/plain
echo
printenv
Or escape them properly:
#!/usr/bin/perl
use CGI ":all";
use HTML::Entities;
print header,
start_html("env"),
h1("env"), # can't have h2 without h1, c'mon!
table({-border => 1},
Tr([map td([map encode_entities($_), $_, $ENV{$_}]),
sort keys %ENV])),
end_html;
-- Randal L. Schwartz, Perl hacker |