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=829341e01cf7a04a81e6368674d7f6a345671681;hp=e95a00832e072f0f3cf5d3b183a212d3f760c574;hb=658f6c563d745506a79cde37038547886ff48155;hpb=8d732f3064bb88d682504f365ef1af62c6598b8c diff --git a/lib/Eval/WithLexicals/WithHintPersistence.pm b/lib/Eval/WithLexicals/WithHintPersistence.pm index e95a008..829341e 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.001000'; # 1.1.0 +our $VERSION = '1.003006'; # v1.3.6 $VERSION = eval $VERSION; -# Used localised -our($hints, %hints); - has hints => ( is => 'rw', default => quote_sub q{ {} }, @@ -67,14 +64,25 @@ 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->(@_) ) }; +1; +__END__ + =head1 NAME Eval::WithLexicals::WithHintPersistence - Persist compile hints between evals @@ -101,6 +109,16 @@ Saves and restores the C<$^H> and C<%^H> variables. Returns the internal hints hash, keys are C<$^H> and C<%^H> for the hint bits and hint hash respectively. -=cut +=head1 SUPPORT -1; +See L for support and contact information. + +=head1 AUTHORS + +See L for authors. + +=head1 COPYRIGHT AND LICENSE + +See L for the copyright and license. + +=cut