Perl::Critic is a static code analysis tool for identifying potential problems and enforcing coding standards in Perl source code. It examines programs without executing them, reporting constructs that may be difficult to maintain, error-prone or inconsistent with established coding practices.
The tool uses a collection of configurable policies, many inspired by Damian Conway’s book Perl Best Practices. Developers can enable, disable or customise individual policies to match their preferred coding conventions. The framework also supports custom policies, allowing teams to enforce project-specific requirements rather than relying exclusively on predefined rules.
Perl::Critic can analyse individual files, entire directories or source supplied through standard input. It is suitable for interactive code reviews, automated testing and checking coding standards across larger projects. Its reporting and configuration facilities make it useful for both new code and established codebases.
This is free and open source software.
Key Features
- Static analysis of Perl source code without executing the program.
- Extensive collection of policies covering coding style, maintainability and potential programming errors.
- Configurable policy severity levels from gentle to brutal.
- Enable or disable individual policies according to project requirements.
- Group policies into themes covering security, complexity, maintenance, bugs and other categories.
- Combine policy themes using logical expressions.
- Custom configuration profiles using .perlcriticrc files.
- Support for user-defined policies and third-party policy collections.
- Analyse individual files, directories and standard input.
- Recursive analysis of Perl source files within directories.
- Configurable diagnostic output with filenames, line numbers, severity levels and policy descriptions.
- Report statistics about analysed code and detected violations.
- Suppress selected policies for specific code sections using inline annotations.
- Limit analysis to selected policies or report only the most significant violations.
- Integration with automated testing through Test::Perl::Critic.
- Programmatic interface for incorporating static analysis into other development tools.
Website: github.com/Perl-Critic/Perl-Critic
Support:
Developer: Perl::Critic Core Maintainers
License: Artistic License 1.0 / GNU General Public License v1.0
Perl-Critic is written in Perl. Learn Perl with our recommended free books and free tutorials.
Related Software
| Perl Linters | |
|---|---|
| Perl::Critic | Extensible framework for creating and applying coding standards |
| Perltidy | Indents and reformats Perl scripts |
| zarn | Static security analysis for source code and dependencies |
| perl-lsp | Language Server Protocol implementation for Perl |
Read our verdict in the software roundup.
LinuxLinks helps you discover the best free and open source software for Linux. Explore our extensive collection of recommended applications, including alternatives to popular proprietary software.We also publish software reviews, Linux tutorials, hardware reviews, free programming books and articles covering the wider open source community. Browse our Linux resources to discover more. Know a useful free and open source Linux application we haven't covered? Suggest a program for inclusion. Has your software been featured on LinuxLinks? Display one of our Featured on LinuxLinks badges on your website or GitHub README. |


Please read our Comment Policy before commenting.