Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

jonasbn (1153)

  reversethis-{gro.napc} {ta} {nbsanoj}
AOL IM: BJonasN (Add Buddy, Send Message)

Perl Programmer located in Copenhagen, Denmark. Active member of Copenhagen Perl Mongers.

Author of:

  • Business::DK::CPR
  • Business::DK::CVR
  • Business::DK::PO
  • Business::OnlinePayment::CashCow
  • Date::Holidays
  • Date::Holidays::Abstract
  • Date::Holidays::Super
  • Date::Pregnancy
  • Games::Bingo
  • Games::Bingo::Bot
  • Games::Bingo::Print
  • Module::Info::File
  • Module::Template::Setup
  • Test::Timer

and maintainer of:

  • Tie::Tools
  • XML::Conf
  • Workflow

Journal of jonasbn (1153)

Wednesday November 16, 2005
05:10 AM

Perl::Critic and Module::Checkstyle

[ #27591 ]

During the Nordic Perl Workshop I sat down during Claes Jacobssons lightning talk on his: Module::Checkstyle and whipped up a small script to try it out.

use Module::Checkstyle;

my $checkstyle = Module::Checkstyle->new();
foreach my $problem ($checkstyle->get_problems) {
                print $problem, "\n";

The example is taken from the POD and I can only say that I credit Claes for having such a usable synopsis in his POD.

I also checked out Perl::Critic, mentioned by Claes.

use Perl::Critic;

my $critic = Perl::Critic->new();

open(FIN, ");

my @violations = $critic->critique(\$source_code);
foreach (@violations) {
                print $_."\n";

It was quite interesting to compare the two - I suggested Claes to have his module use perlstyle as the default and sent him a single bug report for a module not specified in the Makefile.PL

I have not gotten around to reading the Perl Best Practices by Damian Conway - I have only listened to the perlcast. but I am looking forward to integrating one of or both modules into my build proces.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • So what kind of differences did you notice between the two? Do they give conflicting or compelmentary results? Do you have any thoughts on how these types of modules should work. As the author of Perl::Critic, I'm just curious to see what other people think. Thanks for your feedback. -Jeff
    • Well I should do a more thorough analysis, recommending any of the two :)

      Anyway I see the two modules having to different scopes.

      Where Perl::Critic is focused on the well defined set of best practices from the book 'Perl Best Practices', Module::CheckStyle is more general - and can be configured into applying a check for any styleguide, which makes it more interesting in conjunction with for example a company coding guideline, perhaps even PerlStyle. I actually asked Claes to let the module implement PerlSt