Author of:
and maintainer of:
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();
$checkstyle->check($ARGV[0]);
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, ");
close(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.
Re: Perl::Critic and Module::Checkstyle (Score:1)
Re: Perl::Critic and Module::Checkstyle (Score:2)
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