NAME

HTML::Perlinfo - Display a lot of Perl information in HTML format

SYNOPSIS

use HTML::Perlinfo;

perlinfo();

DESCRIPTION

This module outputs a large amount of information about your Perl installation in HTML. So far, this includes information about Perl compilation options, the Perl version, server information and environment, HTTP headers, OS version information, Perl modules, and more.

HTML::Perlinfo is aimed at Web developers, but almost anyone using Perl may find it useful.

Since the module outputs HTML, you may want to use it in a CGI script, but you do not have to. Of course, some information, like HTTP headers, would not be available if you use the module at the command-line.

OPTIONS

There are 6 options to pass to the perlinfo funtion. All of these options are also object methods. The key difference is their case: Captilize the option name when passing it to the function and use only lower-case letters when using the object-oriented approach.

INFO_GENERAL

The configuration line, build date, Web Server, System and more.

INFO_VARIABLES

Shows all predefined variables from EGPCS (Environment, GET, POST, Cookie, Server).

INFO_CONFIG

All configuration values from config_sh. INFO_ALL shows only some values.

INFO_APACHE

Apache HTTP server information.

INFO_MODULES

All installed modules, their version number and more. INFO_ALL shows only core modules.

INFO_LICENSE

Perl license information.

INFO_CREDITS

Shows the credits for Perl, listing the Perl pumpkings, developers, module authors, etc.

INFO_ALL

Shows all of the above. This is the default value.

CUSTOMIZING THE HTML

The simpliest way to alter the HTML is to assign it to a scalar. For example:

my $example = perlinfo();    # Now I can do whatever I want with $example
$example =~ s/Perl/Java/ig;  # Make everyone laugh  
print $example;       

HTML::Perlinfo also provides object methods which make altering some HTML elements less helter skelter.

OBJECT METHODS

These object methods allow you to change the HTML CSS settings to achieve a stylish effect. When using them, you must pass them a parameter. Please see your favorite HTML guide for acceptable CSS values. Refer to the HTML source code of perlinfo for the defaults.

Method name/Corresponding CSS element

title                  / page title (only non-CSS element)
bg_image 		/ background_image
bg_position 		/ background_position
bg_repeat 		/ background_repeat
bg_attribute 		/ background_attribute 
bg_color 		/ background_color
ft_family 		/ font_familty 
ft_color 		/ font_color
lk_color 		/ link color
lk_decoration 		/ link text-decoration  
lk_bgcolor 		/ link background-color 
lk_hvdecoration 	/ link hover text-decoration 
header_bgcolor 	/ table header background-color 
header_ftcolor 	/ table header font color
leftcol_bgcolor	/ background-color of leftmost table cell  
leftcol_ftcolor 	/ font color of left table cell
rightcol_bgcolor	/ background-color of right table cell  
rightcol_ftcolor	/ font color of right table cell

EXAMPLES

Function-oriented style:

# Show all information, defaults to INFO_ALL
perlinfo();

# Show only module information. This shows all installed modules.
perlinfo(INFO_MODULES);

Object-oriented style:

	$p = new HTML::Perlinfo;
	$p->bg_color("#eae5c8");
	$p->info_all;

	# You can also set the CSS values in the constructor!
    	$p = HTML::Perlinfo->new(
		bg_image  => 'http://www.tropic.org.uk/~edward/ctrip/images/camel.gif',
		bg_repeat => 'yes-repeat'
	);
	$p->info_all;

More examples . . .

# This is wrong (no capitals!)
$p->INFO_CREDITS;

# But this is correct
perlinfo(INFO_CREDITS);

# Ditto
$p->info_credits;

no_links

To remove all the default links and images, you can use the no_links method.

$p->no_links;
$p->info_all; # contains no images or links. Good for printing!

There are many links (mostly to module documentation) and a few images of camels in the default function. HTML::Perinfo will also detect if the client and server are the same machine and provide links to the local location of a module. This is useful if you want to see the local installation directory of a module in your browser.

More functions for altering the HTML in exciting ways will come in future versions.

SECURITY

Displaying detailed server information on the internet is not a good idea if security is a top concern, as it is for most system administrators, and HTML::Perlinfo reveals a lot of information about the local environment. While restricting what system users can publish online is wise, you can also hinder them from using the module by installing it outside of the usual module directories (see perldoc -q lib). Of course, preventing users from installing the module in their own home directories is another matter entirely.

REQUIREMENTS

HTML::Perlinfo requires only 3 non-core modules. These 3 modules are:

App::Info (for some HTTPD information)

Module::CoreList (for Perl release dates)

File::Which (for searching the path)

NOTES

Some might notice that HTML::Perlinfo shares the look and feel of the PHP function phpinfo. It was originally inspired by that function and was first in the PHP namespace as PHP::Perlinfo, which is no longer available on CPAN.

RELEASE SCHEDULE

Every month or so, there will be a new version. Version numbers will increase by 0.05 to reflect the large amount of changes expected with each release. Emergency releases will bump the version by 0.01.

BUGS

Please report any bugs or feature requests to bug-html-perlinfo@rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=HTML-Perlinfo. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SEE ALSO

Perl Diver and Perl Digger are free CGI scripts that offer similar information.

Perl Diver: http://www.scriptsolutions.com/programs/free/perldiver/

Perl Digger: http://sniptools.com/perldigger

Other modules worth mentioning:

Config. You can also use "perl -V" to see a configuration summary at the command-line.

Apache::Status, App::Info, Probe::Perl, Module::CoreList, Module::Info, among others.

AUTHOR

Mike Accardo <mikeaccardo@yahoo.com>

COPYRIGHT

  Copyright (c) 2005, Mike Accardo. All Rights Reserved.
This module is free software. It may be used, redistributed
and/or modified under the terms of the Perl Artistic License.