#!usr/bin/perl -w use strict; $|++; use CGI; my $q = new CGI; my @params = $q->param; my ($environment, $params); $environment .= " ".escapeHTML($_)."".escapeHTML($ENV{$_})."\n" for keys %ENV; $params .= " ".escapeHTML($_)."".escapeHTML($q->param($_))."\n" for @params; print < Spew Entire CGI Environment

Environment Variables

$environment
ENV VARValue

CGI Parameters

$params
ParamValue
HTML sub escapeHTML { local $_ = shift; # make the required escapes s/&/&/g; s/"/"/g; s//>/g; # make the whitespace escapes - not required within pre tags s/\t/    /g; s/( {2,})/" " x length $1/eg; # make the brower bugfix escapes; s/\x8b/‹/g; s/\x9b/›/g; # make the PERL MONKS escapes (if desired) s/\[/[/g; s/\]/]/g; # change newlines to
if desired - not needed with pre tags # s/\n/
/g; return $_; }