Test::LocalFunctions::Fast - Detects unused local function by Compiler::Lexer
# check modules that are listed in MANIFEST use Test::LocalFunctions::Fast; use Test::More; all_local_functions_ok(); done_testing; # you can also specify individual file use Test::LocalFunctions::Fast; use Test::More; local_functions_ok('/path/to/your/module_or_script'); done_testing;
Test::LocalFunctions::Fast is finds unused local functions to clean up the source code. (Local function means the function which name starts from underscore.)
This module is faster than Test::LocalFunction::PPI, because this module uses Compiler::Lexer as lexical tokenizer.
all_local_functions_ok
This is a test function which finds unused variables from modules that are listed in MANIFEST file.
local_functions_ok
This is a test function which finds unused variables from specified source code. This function requires an argument which is the path to source file.
Compiler::Lexer (version 0.12 or later)
Sub::Identify (version 0.04 or later)
Test::Builder::Module (version 0.98 or later)
Test::Builder::Tester (version 1.22 or later)
Test::LocalFunctions
Test::LocalFunctions::PPI
To install Test::LocalFunctions, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::LocalFunctions
CPAN shell
perl -MCPAN -e shell install Test::LocalFunctions
For more information on module installation, please visit the detailed CPAN module installation guide.