]> git.vpit.fr Git - perl/modules/Perl-Critic-Policy-Dynamic-NoIndirect.git/blobdiff - lib/Perl/Critic/Policy/Dynamic/NoIndirect.pm
Bump copyright year
[perl/modules/Perl-Critic-Policy-Dynamic-NoIndirect.git] / lib / Perl / Critic / Policy / Dynamic / NoIndirect.pm
index 1132c571bec2ef17a43e49c357b2914c71c84d80..624792ec1b688f3114415a926264b7ce1747cb0d 100644 (file)
@@ -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/(?<!\\)((\\\\)*)"/$1\\"/g;
 
  my @errs;
+ my $hook = sub { push @errs, [ @_ ] };
+
  my $wrapper = <<" WRAPPER";
- {
   return;
   package main;
-  no indirect hook => 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");
   }
  }
 
@@ -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.