X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FPerl%2FCritic%2FPolicy%2FDynamic%2FNoIndirect.pm;h=624792ec1b688f3114415a926264b7ce1747cb0d;hb=fc0e88658ce28841996a591681b9068174b314bb;hp=4d4c4d2d6343e99bc562bd25fe8c4f18d22038d8;hpb=0e4837000c33bd7c179a6b22f442f0c63432f8c0;p=perl%2Fmodules%2FPerl-Critic-Policy-Dynamic-NoIndirect.git diff --git a/lib/Perl/Critic/Policy/Dynamic/NoIndirect.pm b/lib/Perl/Critic/Policy/Dynamic/NoIndirect.pm index 4d4c4d2..624792e 100644 --- a/lib/Perl/Critic/Policy/Dynamic/NoIndirect.pm +++ b/lib/Perl/Critic/Policy/Dynamic/NoIndirect.pm @@ -11,11 +11,11 @@ Perl::Critic::Policy::Dynamic::NoIndirect - Perl::Critic policy against indirect =head1 VERSION -Version 0.04 +Version 0.05 =cut -our $VERSION = '0.04'; +our $VERSION = '0.05'; =head1 DESCRIPTION @@ -57,25 +57,26 @@ sub violates_dynamic { $file =~ s/(? sub { push \@errs, [ \@_ ] }; - { - ; + no strict; + no warnings; + no indirect hook => \$hook; + do { #line 1 "$file" $src } - } WRAPPER { local ($@, *_); eval $wrapper; ## no critic - if ($@) { + if (my $err = $@) { require Carp; - Carp::confess("Couldn't compile the source wrapper: $@"); + Carp::croak("Couldn't compile the source wrapper: $err"); } } @@ -130,7 +131,7 @@ L 5.8, L. L, L. -L. +L 0.20. =head1 SEE ALSO @@ -158,7 +159,7 @@ You can find documentation for this module with the perldoc command. =head1 COPYRIGHT & LICENSE -Copyright 2009,2010 Vincent Pit, all rights reserved. +Copyright 2009,2010,2011 Vincent Pit, all rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.