From: Vincent Pit Date: Thu, 25 Aug 2011 14:45:52 +0000 (+0200) Subject: Make the sample script output compilation errors X-Git-Tag: v0.06~1 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FPerl-Critic-Policy-Dynamic-NoIndirect.git;a=commitdiff_plain;h=ea367e59d416e5ce66982f813e8cce81cf5df9d6 Make the sample script output compilation errors --- diff --git a/samples/check.pl b/samples/check.pl index 7f09532..4703f4d 100644 --- a/samples/check.pl +++ b/samples/check.pl @@ -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; +}