<p>One I am aware of is <a href="http://search.cpan.org/dist/Perl-Critic/" rel="nofollow noreferrer">Perl::Critic</a></p>

<p>And my googling has resulted in no results on multiple attempts so far. :-(</p>

<p>Does anyone have any recommendations here?</p>

<p>Any resources to configure Perl::Critic as per our coding standards and run it on code base would be appreciated.</p>

[{'answer_id': 51522, 'author': 'svrist', 'author_id': 86, 'author_profile': 'https://Stackoverflow.com/users/86', 'pm_score': 2, 'selected': False, 'text': '<p>Like: </p>\n\n<ul>\n<li><a href="http://metacpan.org/pod/Perl::Critic" rel="nofollow noreferrer">http://metacpan.org/pod/Perl::Critic</a></li>\n<li><a href="http://www.slideshare.net/joshua.mcadams/an-introduction-to-perl-critic/" rel="nofollow noreferrer">http://www.slideshare.net/joshua.mcadams/an-introduction-to-perl-critic/</a></li>\n</ul>\n\n<p>Looks like a nice tool!</p>\n'}, {'answer_id': 51565, 'author': 'Leon Timmermans', 'author_id': 4727, 'author_profile': 'https://Stackoverflow.com/users/4727', 'pm_score': 3, 'selected': False, 'text': '<p>There is <a href="http://perltidy.sourceforge.net/" rel="nofollow noreferrer">perltidy</a> for most stylistic standards. perlcritic can be easily configured using a <a href="http://search.cpan.org/~thaljef/Perl-Critic-1.092/lib/Perl/Critic.pm#CONFIGURATION" rel="nofollow noreferrer">.perlcritic file</a>. I personally use the it at level one, but I\'ve disabled a few policies.</p>\n'}, {'answer_id': 55274, 'author': 'talexb', 'author_id': 5649, 'author_profile': 'https://Stackoverflow.com/users/5649', 'pm_score': 2, 'selected': False, 'text': "<p>In addition to 'automated frameworks', I highly recommend Damian Conway's <em>Perl Best Practices</em>. I don't agree with 100% of what he suggests, but most of the time he's bang on.</p>\n"}, {'answer_id': 62041, 'author': 'Alex Francis', 'author_id': 6422, 'author_profile': 'https://Stackoverflow.com/users/6422', 'pm_score': 1, 'selected': False, 'text': '<p>A nice combination is perlcritic with EPIC for Eclipse - hit <kbd>CTRL</kbd>-<kbd>SHIFT</kbd>-<kbd>C</kbd> (or your preferred configured shortcut) and your code is marked up with warning indicators wherever perlcritic has found something to complain about. Much nicer than remembering to run it before checkin. And as normal with perlcritic, it will pick up your .perlcriticrc so you can customise the rules. We keep our .perlcriticrc in version control so everyone gets the same standards.</p>\n'}, {'answer_id': 62714, 'author': 'Elliot Shank', 'author_id': 6825, 'author_profile': 'https://Stackoverflow.com/users/6825', 'pm_score': 5, 'selected': True, 'text': '<p>In terms of setting up a profile, have you tried <code>perlcritic --profile-proto</code>?  This will emit to stdout all of your installed policies with all their options with descriptions of both, including their default values, in perlcriticrc format.  Save and edit to match what you want. Whenever you upgrade Perl::Critic, you may want to run this command again and do a diff with your current perlcriticrc so you can see any changes to existing policies and pick up any new ones.</p>\n\n<p>In terms of running perlcritic regularly, set up a <a href="http://search.cpan.org/dist/Test-Perl-Critic/" rel="noreferrer">Test::Perl::Critic</a> test along with the rest of your tests. This is good for new code.</p>\n\n<p>For your existing code, use <a href="http://search.cpan.org/dist/Test-Perl-Critic-Progressive/" rel="noreferrer">Test::Perl::Critic::Progressive</a> instead. T::P::C::Progressive will succeed the first time you run it, but will save counts on the number of violations; thereafter, T::P::C::Progressive will complain if any of the counts go up. One thing to look out for is when you revert changes in your source control system. (You are using one, aren\'t you?) Say I check in a change and run tests and my changes reduce the number of P::C violations. Later, it turns out my change was bad, so I revert to the old code. The T::P::C::Progressive test will fail due to the reduced counts. The easiest thing to do at this point is to just delete the history file (default location t/.perlcritic-history) and run again. It should reproduce your old counts and you can write new stuff to bring them down again.</p>\n\n<p>Perl::Critic has a lot of policies that ship with it, but there are a bunch of add-on distributions of policies. Have a look at <a href="http://search.cpan.org/dist/Task-Perl-Critic/" rel="noreferrer">Task::Perl::Critic</a> and <a href="http://search.cpan.org/dist/Task-Perl-Critic-IncludingOptionalDependencies/" rel="noreferrer">\nTask::Perl::Critic::IncludingOptionalDependencies</a>.</p>\n\n<p>You don\'t need to have a single perlcriticrc handle all your code. Create separate perlcriticrc files for each set of files you want to test and then a separate test that points to each one. For an example, have a look at the author tests for P::C itself at <a href="http://perlcritic.tigris.org/source/browse/perlcritic/trunk/Perl-Critic/xt/author/" rel="noreferrer">http://perlcritic.tigris.org/source/browse/perlcritic/trunk/Perl-Critic/xt/author/</a>. When author tests are run, there\'s a test that runs over all the code of P::C, a second test that applies additional rules just on the policies, and a third one that criticizes P::C\'s tests.</p>\n\n<p>I personally think that everyone should run at the "brutal" severity level, but knock out the policies that they don\'t agree with. Perl::Critic isn\'t entirely self compliant; even the P::C developers don\'t agree with everything Conway says. Look at the perlcriticrc files used on Perl::Critic itself and search the Perl::Critic code for instances of "## no critic"; I count 143 at present.</p>\n\n<p>(Yes, I\'m one of the Perl::Critic developers.)</p>\n'}, {'answer_id': 70688, 'author': 'jonfm', 'author_id': 6924, 'author_profile': 'https://Stackoverflow.com/users/6924', 'pm_score': 0, 'selected': False, 'text': '<p>In addition to the cosmetic best practices, I always find it useful to run Devel::Prof on my unit test suite to check test coverage.</p>\n'}, {'answer_id': 77699, 'author': 'jplindstrom', 'author_id': 10155, 'author_profile': 'https://Stackoverflow.com/users/10155', 'pm_score': 2, 'selected': False, 'text': '<p>The post above mentioning <a href="http://metacpan.org/pod/Devel::Prof" rel="nofollow noreferrer">Devel::Prof</a> probably really means <a href="http://metacpan.org/pod/Devel::Cover" rel="nofollow noreferrer">Devel::Cover</a> (to get the code coverage of a test suite).</p>\n'}]
['https://Stackoverflow.com/questions/51499', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4406/']