#!/usr/bin/perl ## Enviroment Variables Plus v1.0 Released: 9-1-00 ## by NESGamepro http://www.wtv-zone.com/nesgamepro # You may have to change the path above to #!/usr/local/bin/perl if the # script is not working. # Name this file anything.pl or anything.cgi and change permissions # (CHMOD) the file to 755. # By using this script you agree that NESGamepro is not responsible # for any damages caused by it, either directly or indirectly. # Sole responsibility is placed on the owner of this copy. # There is no need to edit below this line use File::Find; $plocation =`whereis perl`; @perlloc = split(" ",$plocation); $sendmail =`whereis sendmail`; @mailloc = split(" ",$sendmail); $dateprog =`whereis date`; @dateloc = split(" ",$dateprog); print "Content-type: text/html\n\n"; ## ENV Vars print ""; while (($key,$value) = each %ENV) { print ""; } ## More Vars print < EndMoreVars print "
Environment Variables
$key$value
Debug Flags:$^D
Debugger Flag:$^P
Warning Switch Value:$^W
Perl Executable:$^X
Perl Process Number:$$
Perl being Executed:$0
Perl Version:$]
PERL compile version OS:$^O
Script Start Time:$^T
Real UID:$<
Effective UID:$>
Real GID:
(If not blank, your server supports membership in multiple groups simultaneously)
$(
Effective GID:
(If not blank, your server that supports membership in multiple groups simultaneously)
$)

"; ## Server Program Paths print ""; print ""; print ""; print ""; print ""; print "
Server Program Paths;
Location of Perl:"; foreach $loc(@perlloc) { print "$loc
\n";} print "
Location of Sendmail:"; foreach $loc(@mailloc) { print "$loc
\n";} print "
Location of Date:"; foreach $loc(@dateloc) { print "$loc
\n";} print "
Directory locations searched for perl executables: "; foreach $item(@INC) { print "$item
\n";} print "

"; ## Show Modules print ""; find(\&wanted,@INC); $modcount = 0; foreach $line(@foundmods) { $match = lc($line); if ($found{$line}[0] >0) {$found{$line} = [$found{$line}[0]+1,$match]} else {$found{$line} = ["1",$match]; $modcount++ } } @foundmods = sort count keys(%found); sub count {return $found{$a}[1] cmp $found{$b}[1] } $third = $modcount/3; print "
Installed Modules
"; $count=0; foreach $mod(@foundmods) { chomp $mod; $count++; if ($count <= $third) { print ""; } else {push (@mod1,$mod) } } print "
$mod
"; $count = 0; foreach $mod1(@mod1) { chomp $mod1; $count++; if ($count <= $third) { print ""; } else { push (@mod2,$mod1) } } print "
$mod1
"; $count = 0; foreach $mod2(@mod2) { chomp $mod2; $count++; if ($count <= $third){ print ""; } } print "
$mod2
";exit; sub wanted { $count = 0; if ($File::Find::name =~ /\.pm$/) { open(MODFILE,$File::Find::name) || return; while() { if (/^ *package +(\S+);/) { push (@foundmods, $1); last; } } } }