Perl::Analysis::Static - analyse your Perl documents (without running them)
version 0.004
Perl::Analysis::Static extracts information from your Perl sources. It's a toolbox for developers to take a look at their code. It examines the code without running it.
Perl is notoriously hard to parse because of its flexible syntax. Thus, programs (and sometimes humans) have a hard time telling where variables are declared, subroutines are called and if they are used at all. The tools in this distribution hope to give humans and programs the means to get answers for questions about perl code.
Humans may use the perlanalyst on the command line whilst machines ought to use the API provided by Perl::Analysis::Static::Question and friends.
Here are some basic examples to help get you started.
# find all subroutine declarations, recursively process all Perl # files beneath directory perlanalyst --all Sub # the same, but show only the declaration of the subroutine "foo" perlanalyst --all Sub --filter Name=foo # the same, but asked as a question perlanalyst --question Sub::Name=foo # the same, but look in another directory perlanalyst -q Sub::Name=foo ~/perl5/lib/perl5/Test # list questions you may ask perlanalyst --list-questions # list analyses perlanalyst --list-analyses # list filters perlanalyst --list-filters # see a list of the files that would be examined perlanalyst --list-files
Please refer to the file INSTALL for documentation of the installation process.
This is alpha software. This means that everything may change any time. Programs, modules and variables might be renamed, APIs may be created or deleted, command line arguments may vanish.
The wonderful PPI, which we use for parsing sources, introduced the concept of a Perl document. We'll stick with that terminology.
PPI is used for parsing the Perl documents.
Perl::Critic is a different kind of tool. It has the knowledge of experienced perl programmers built in and tells you if your code smells.
Gregor Goldbach <glauschwuffel@nomaden.org>
This software is copyright (c) 2011 by Gregor Goldbach.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Perl::Analysis::Static, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Perl::Analysis::Static
CPAN shell
perl -MCPAN -e shell install Perl::Analysis::Static
For more information on module installation, please visit the detailed CPAN module installation guide.