#!/usr/bin/perl -w =head1 NAME printenv.pl - prints out as much info as it can find about the current http request =cut use strict; use Sys::Syslog; use CGI qw(:all); use Env; use strict; Env::import(); my %urec2; my $stat; my $item; my $value; my ( $key, $val); my @names; my $query; $query = new CGI; @names = $query->param; no strict 'subs'; print "Content-type: text/html\n\n"; # @names = $CGI::Q->param; print "Starting Dump of CGI names:\n
"; foreach $item (@names) { print "name item: $item;
"; } print "Dump of cgi names complete.\n
"; print "Starting Dump of command line:\n
"; foreach $item (@ARGV){ print "$item;
"; } print "Dump of command line complete.\n
"; print "Dumping \$0:\n
"; print "$0:\n
"; print "Dump of \$0 complete.\n
"; print "Starting Dump of Environment variables:\n
"; while (($key, $val) = each %ENV) { print "$key = $val
\n"; } print "Dump of Environment complete.\n
"; print "Starting Dump of CGI NAME VALUE Pairs :\n
"; foreach $item ( @names) { $value = $query->param("$item"); printf("%s=%s.\n
",$item,$value); } print "Dump of pairs complete.\n
";