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=d6a4ac0a60b7a641a12057dec91afd2f9a7bbd0d;hp=c50fbbba61245ff2204d80d0acb4871c1bc652f2;hb=14786ff863ce8fbc95583e3a39b9ca29c4f0958c;hpb=9aa1478d9dfdcd7d75b5a4017c091b8816076784 diff --git a/lib/Eval/WithLexicals/WithHintPersistence.pm b/lib/Eval/WithLexicals/WithHintPersistence.pm index c50fbbb..d6a4ac0 100644 --- a/lib/Eval/WithLexicals/WithHintPersistence.pm +++ b/lib/Eval/WithLexicals/WithHintPersistence.pm @@ -67,14 +67,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 +112,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