X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FEval-WithLexicals.git;a=blobdiff_plain;f=lib%2FEval%2FWithLexicals%2FWithHintPersistence.pm;h=cf03878695cbab5667f8843fe1ab5129780ac03f;hp=0c09a23ececc4cdad0601b601754e1eb1aab3042;hb=f19eca699a0d4520a3e6d3a3f7dd6c134ae8749d;hpb=541530120ed1bc9036192432fb47ec7be3927c67 diff --git a/lib/Eval/WithLexicals/WithHintPersistence.pm b/lib/Eval/WithLexicals/WithHintPersistence.pm index 0c09a23..cf03878 100644 --- a/lib/Eval/WithLexicals/WithHintPersistence.pm +++ b/lib/Eval/WithLexicals/WithHintPersistence.pm @@ -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->(@_) ) };