Use B::Hooks::EndOfScope instead of %^H and Scope::Guard.
[p5sagit/Devel-Declare.git] / lib / Devel / Declare.pm
index c90f6a7..a315f66 100644 (file)
@@ -4,7 +4,7 @@ use strict;
 use warnings;
 use 5.008001;
 
-our $VERSION = '0.002000';
+our $VERSION = '0.002002';
 
 use constant DECLARE_NAME => 1;
 use constant DECLARE_PROTO => 2;
@@ -290,13 +290,13 @@ Devel::Declare -
 =head1 SYNOPSIS
 
   use Devel::Declare ();
-  use Scope::Guard;
   
   {
     package MethodHandlers;
   
     use strict;
     use warnings;
+    use B::Hooks::EndOfScope;
   
     our ($Declarator, $Offset);
   
@@ -391,13 +391,12 @@ Devel::Declare -
     }
   
     sub inject_scope {
-      $^H |= 0x120000;
-      $^H{DD_METHODHANDLERS} = Scope::Guard->new(sub {
+      on_scope_end {
         my $linestr = Devel::Declare::get_linestr;
         my $offset = Devel::Declare::get_linestr_offset;
         substr($linestr, $offset, 0) = ';';
         Devel::Declare::set_linestr($linestr);
-      });
+      };
     }
   }
   
@@ -485,13 +484,15 @@ Devel::Declare -
 
 Currently valid op types: 'check', 'rv2cv'
 
-=head1 AUTHOR
+=head1 AUTHORS
 
 Matt S Trout - <mst@shadowcat.co.uk>
 
 Company: http://www.shadowcat.co.uk/
 Blog: http://chainsawblues.vox.com/
 
+Florian Ragwitz E<lt>rafl@debian.orgE<gt>
+
 =head1 LICENSE
 
 This library is free software under the same terms as perl itself