5 use CGI::Carp qw(fatalsToBrowser);
8 # List of modules, required direcrty by your application
10 my @modules=qw(MIME::Lite Image::Size HTML::TreeBuilder
11 POSIX Storable Fcntl Date::Parse
12 LWP::UserAgent Net::OpenID::Consumer Email::Valid);
15 # This array have to be filled manually by looking into Makefile.PL:
16 # of neccessary CPAN modules and copying contents of PREREQ_PM argument
17 # of it. Of course, recursively.
20 "Net::OpenID::Consumer" => {
21 'LWP::UserAgent' => 0,
30 "HTML::TreeBuilder" => {
31 "HTML::Parser" => 2.19,
32 'HTML::Tagset' => 3.02,
35 'Class::ErrorHandler' =>0,
59 print $cgi->header(-type=>'text/html',-charset=>'windows-1251'),
60 $cgi->start_html(-title=>'Hosting information');
62 print $cgi->h1("Hosting information");
63 print $cgi->h2("Perl information");
64 print "Perl version:",$cgi->escapeHTML($]),"<br>\n";
65 print "\@INC:",$cgi->escapeHTML(join(" ",@INC)),"<br>\n";
66 print "CGI.pm version: $CGI::VERSION<br>";
67 print $cgi->h2("Required modules");
69 for $module (@modules) {
70 if (exists $modver{$module}) {
71 $ver = $modver{$module}
73 eval "use $module; \$ver=\$${module}::VERSION;";
75 print "$module : <font color=\"red\">not found</font><br>";
76 if (exists $prereq{$module}) {
81 $modver{$module} = $ver;
83 print "$module: $ver<br>";
86 print $cgi->h2("Execution environment"),"\n";
88 print "Script execution directory: <tt>",getcwd,"</tt><br>\n";
89 print "Invoking user id ",$(+0," name(getpwuid) <tt>".(getpwuid($())[0]."</tt><br>\n";
90 print "User home directory (getpwuid): <tt>".(getpwuid($())[7]."</tt><br>\n";
91 print "User home directory(environment): <tt>",$ENV{'HOME'},"</tt><br>\n";
92 print "Script name (\$0): <tt>$0</tt><br>\n";
93 print "Script filename (from <b>SCRIPT_FILENAME</b> env var)
94 <tt>$ENV{'SCRIPT_FILENAME'}</tt.<br>\n";
95 print "Document root: <tt>$ENV{'DOCUMENT_ROOT'}</tt><br>\n";
96 print "<b>LANG</b>: <tt>$ENV{LANG}</tt><br>\n";
97 print "<b>SERVER_ADDR</b>: <tt>$ENV{SERVER_ADDR}</tt><br>\n";
98 print "<b>PATH</b>: $ENV{'PATH'}<br>\n";
101 my ($sysname, $nodename, $release, $version, $machine) = POSIX::uname();
102 print "System: $sysname $release $version (from POSIX::uname)<br>\n";
105 print "System: `uname -a` (from OS uname command)<br>\n";
109 print "<br><b>Prerequistes for $module</b>:<br><blockquote>\n";
112 while (my ($mod,$needed_ver) = each %{$prereq{$module}}) {
113 if (exists $modver{$module}) {
114 $ver = $modver{$module};
116 eval "use $mod; \$ver=\$${mod}::VERSION;";
118 print "$mod : <font color=\"red\">not found</font><br>";
119 if (exists $prereq{$mod}) {
124 $modver{$mod} = $ver;
126 if ($ver < $needed_ver) {
127 print "$mod: <font color=\"red\">$ver</font> (need $needed_ver<br>\n";
129 print "$mod: $ver<br>\n";
132 print "</blockquote>\n";