#!/usr/bin/perl ################################################################ # # # PerlDiver v1.1 # # Copyright ©1999 - Tintagel Consulting, LLC # # dba Script Solutions # # http://www.scriptsolutions.com/ # # All rights reserved # # # ################################################################ # # # PURPOSE OF PROGRAM: # # # # PerlDiver v1.1 gives you the location of your sendmail # # program, your path to perl, your environment variables and # # most (not all) of the Perl modules that are installed on # # your web server. # # # # INSTRUCTIONS: # # # # Complete instructions and the newest version are located at: # # http://www.scriptsolutions.com/programs/free/perldiver/ # # # # # # LICENSE AGREEMENT: # # # # By downloading and installing PerlDiver v1.1, you have # # agreed to indemnify, defend, and hold harmless Tintagel # # Consulting, LLC dba Script Solutions from any and all # # liability, penalties, losses, damages, costs, expenses, # # attorneys' fees, causes of action or claims caused by or # # resulting indirectly from your use of this script which # # damages either you, or any other party or parties without # # limitation or exception. This indemnification and hold # # harmless agreement extends to all issues associated with # # this script. # # # ################################################################ ################################################################ # DO NOT CHANGE ANYTHING BELOW # $sendmail =`whereis sendmail`; $plocation =`whereis perl`; @perlloc = split(" ",$plocation); @mailloc = split(" ",$sendmail); $font = ''; &vars; print "Content-type: text/html\n\n"; print qq~$program $version
 
 

$dev
$program $version

$fontServer Program Paths

${font}Perl Executable: ${font}$^X
${font}Perl Version: ${font}$]
${font}PERL compile version OS: ${font}$^O
${font}GID: (If not blank, you are on a machine that supports membership in multiple groups simultaneously) ${font}$<
${font}Location of Perl: ${font}~; foreach $loc(@perlloc){ print "$loc
\n"; } print qq~
${font}Location of Sendmail: ${font}~; foreach $ml(@mailloc){ print "$ml
\n"; } print qq~
${font} Directory locations searched for perl executables$font~; foreach $item(@INC){ print "$item
\n"; } print qq~

$fontEnvironment Variables

~; foreach $fieldname(keys %ENV){ print qq~~; } print qq~
${font}$fieldname ${font}$ENV{$fieldname}

$fontInstalled Modules

~;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; $count=0; print "
"; foreach $mod(@foundmods){ chomp $mod; $count++; if ($count <= $third){ print qq~~; } else {push (@mod1,$mod)}} print "
${font}$mod
";$count = 0;foreach $mod1(@mod1){ chomp $mod1; $count++; if ($count <= $third){ print qq~~; } else { push (@mod2,$mod1)}} print "
${font}$mod1
"; $count = 0; foreach $mod2(@mod2){ chomp $mod2; $count++; if ($count <= $third){ print qq~~; }} print qq~
${font}$mod2


${font}The latest version of $program can always be found on ${dev}'s web site.

$font© 1999, ScriptSolutions , a Tintagel project.

 
 
~; exit; sub vars {$dev="ScriptSolutions"; use File::Find; $bgcolor = "GHOSTWHITE"; $program="perl diver"; $version="1.1"; }sub wanted { $count = 0; if ($File::Find::name =~ /\.pm$/){ open(MODFILE,$File::Find::name) || return; while(){ if (/^ *package +(\S+);/){ push (@foundmods, $1); last; } } }}