Bumping version to 1.003005
[p5sagit/Eval-WithLexicals.git] / lib / Eval / WithLexicals / WithHintPersistence.pm
index 0c09a23..cf03878 100644 (file)
@@ -2,12 +2,9 @@ package Eval::WithLexicals::WithHintPersistence;
 use Moo::Role;
 use Sub::Quote;
 
-our $VERSION = '1.002000'; # 1.2.0
+our $VERSION = '1.003005'; # 1.3.5
 $VERSION = eval $VERSION;
 
-# Used localised
-our($hints, %hints);
-
 has hints => (
   is => 'rw',
   default => quote_sub q{ {} },
@@ -67,10 +64,18 @@ around capture_code => sub {
   my($self) = @_;
 
   ( q{ sub Eval::WithLexicals::Cage::capture_hints {
-          no warnings 'closure';
-          my($hints, %hints);
-          BEGIN { $hints = $^H; %hints = %^H; }
-          return q{$^H} => \$hints, q{%^H} => \%hints;
+          my ($hints, %hints, $warn_bits);
+          BEGIN {
+            no warnings 'closure';
+            $hints = $^H;
+            %hints = %^H;
+            $warn_bits = ${^WARNING_BITS};
+          }
+          return (
+            q{$^H}              => \$hints,
+            q{%^H}              => \%hints,
+            q{${^WARNING_BITS}} => \$warn_bits,
+          );
         } },
     $orig->(@_) )
 };