Run Perl::Critic static analysis "While U Type" via Emacs Flymake.
Emacs Lisp Shell
Latest commit edfaa86 Oct 29, 2012 @illusori illusori Add security warning to README about perl -c and BEGIN blocks for tho…
…se unaware of the issues.


Perl::Critic plugin for Emacs Flymake mode

Flymake mode is an Emacs mode that allows you to run continuous syntax checks against the current buffer "While U Type".

Perl::Critic is a static analysis tool for Perl that can be configured to produce a wide range of warnings and errors according to various customizable coding standards.

Emacs-flymake-perlcritic glues the two together, giving you continuous static analysis as you edit.


You will also need Perl::Critic installed, this can be installed via CPAN:

  • cpan Perl::Critic

Once you have both of those installed you can install flymake-perlcritic.el somewhere that emacs can find it and add something like the following to your .emacs:

;; If flymake_perlcritic isn't found correctly, specify the full path
(setq flymake-perlcritic-command

;; Lets set it to be the most severe available.
(setq flymake-perlcritic-severity 1)

;; If you don't want to use the default ~/.perlcriticrc
(setq flymake-perlcritic-profile "~/projects/big-project/perlcriticrc")

(require 'flymake-perlcritic)

Have fun.

Known Issues

  • Perl syntax checking also uses "perl -c", which executes BEGIN blocks, this can be considered a security vulnerability when opening untrusted files. For more information:

See Also

You might also be interested in my patched version of flymake.el which contains fixes and enhancements that can be used by flymake-perlcritic.el, you can grab it from here: