NAME

B::Fathom - a module to evaluate the readability of Perl code

SYNOPSIS

perl -MO=Fathom <script>

or

perl -MO=Fathom,-v <script>

where <script> is the name of the Perl program that you want to evaluate.

-v activates verbose mode, which currently reports which subs have been skipped over because they seem to be imported. One can also indicate -vN, where N is some number greater than zero, to provide even more verbose diagnostics. The specifics of these modes may change in future releases. See comments in the code for further information.

There is also an OO interface, which can be used as follows:

my $fathom  = B::Fathom->new('-v');
my $score   = $fathom->fathom(\&foo);

See METHODS below for a more complete explanation of the OO interface.

DESCRIPTION

B::Fathom is a backend to the Perl compiler; it analyzes the syntax of your Perl code, and estimates the readability of your program.

Currently, this module's idea of `readability' is based on methods used for analyzing readability of English prose. Further extensions are intended.

METHODS

There is a simple object-oriented interface to B::Fathom. It consists of two methods:

new(@args)

This method constructs a new compiler object. The optional @args indicate compiler options; see SYNOPSIS for a list.

fathom(@subrefs)

This method grades the subroutines referred to by @subrefs, and returns their score as a string.

CAVEATS

Because of the nature of the compiler, Fathom has to do some guessing about the syntax of your program. See the comments in the module for specifics.

Fathom doesn't work very well on modules yet.

AUTHOR

Kurt Starsinic <kstar@cpan.org>

COPYRIGHT

Copyright (c) 1998, 1999, 2000 Kurt Starsinic.
This module is free software; you may redistribute it
and/or modify it under the same terms as Perl itself.