]> git.vpit.fr Git - perl/modules/Perl-Critic-Policy-Dynamic-NoIndirect.git/commitdiff
Make the sample script output compilation errors
authorVincent Pit <vince@profvince.com>
Thu, 25 Aug 2011 14:45:52 +0000 (16:45 +0200)
committerVincent Pit <vince@profvince.com>
Thu, 25 Aug 2011 14:45:52 +0000 (16:45 +0200)
samples/check.pl

index 7f095329ad7caeee2238b245e08aef38f10ad5c2..4703f4d181353b183f4645538ae8537cc374adeb 100644 (file)
@@ -10,4 +10,12 @@ Perl::Critic::TestUtils::block_perlcriticrc();
 
 my $code = shift || exit;
 
-print for eval { pcritique_with_violations('Dynamic::NoIndirect', \$code) };
+my @violations = eval {
+ pcritique_with_violations('Dynamic::NoIndirect', \$code)
+};
+
+if ($@) {
+ print $@;
+} else {
+ print for @violations;
+}