CPAN RT

This Policy warns if any subroutine call that appears in your code is not defined in the symbol table at compile-time.
The intent is to detect typos in the names of packages and subroutines,
and possible failures to import,
declare,
or include all the static subroutines that are invoked by your code..

VERY IMPORTANT: Most Perl::Critic Policies (including all the ones that ship with Perl::Critic> use pure static analysis -- they never compile nor execute any of the code that they analyze.
However,
this policy is very different.
It actually attempts to compile your code and then compares the subroutines mentioned in your code to those found in the symbol table.
Therefore you should not use this Policy on any code that you do not trust,
or may have undesirable side-effects at compile-time (such as connecting to the network or mutating files).

For this Policy to work,
all the modules included in your code must be installed locally,
and must compile without error.
See "CONFIGURATION" for information about controlling where this Policy searches for the included modules.

This Policy will not detect subroutines that are declared at run-time or through direct manipulation of the symbol table,
which may lead to false warnings.
The most common examples of this are modules that use AUTOLOAD.

Sophisticated code often use the require function to postpone loading modules or only load modules under certain conditions.
If you set the inspect_required_modules option,
the Policy will attempt to load all modules that are require'd at any point in your code.
However,
this Policy does not know whether the module would have been loaded during normal execution of your program.
This may cause the Policy to overlook potential violations.

This Policy only examines static subroutine calls -- method calls are not covered.
Indirect method calls such as "my $fh = new FileHandle" also tend to trigger false warnings.

This Policy compiles your code into the same symbol table as Perl::Critic itself.
So to maintain integrity in the symbol table,
this Policy forks itself before analyzing each file.
On some systems,
this may be slow and consume a lot of resources.

By default,
this Policy only examines modules that are loaded by your code at compile-time.
If inspect_required_modules is set to a true value,
this Policy will also compile all the modules that are require'd in your code at runtime.
Note that this Policy does not know if these modules will actually be loaded when your program runs,
nor does it try to invoke the import method on those modules.

By default,
this Policy does not attempt to validate a function call into a package that has an AUTOLOAD method.
Such packages usually define functions at run-time,
so this Policy has no chance of knowing what functions that package might have.
But if inspect_autoloaders is set to a true value,
the Policy will check to see if a function exists in such packages.

By default,
this Policy only looks at the symbol tables for the namespaces that are directly use'd (or require'd) by your code.
However,
some modules contain multiple namespaces which may lead to false violations.
But if you set max_recursion to a positive integer,
this Policy will recurse into those other namespaces.
Beware,
however,
that using a deep recursion can mask other violations.
Setting max_recursion to 1 or 2 is usually sufficient.

You can set these configuration parameters but putting any or all of the following in your .perlcriticrc file.