requires 'Scalar::Util';
build_requires 'Test::More';
-build_requires 'Scope::Guard';
+build_requires 'B::Hooks::EndOfScope';
postamble(<<'EOM');
$(OBJECT) : stolen_chunk_of_toke.c
=head1 SYNOPSIS
use Devel::Declare ();
- use Scope::Guard;
{
package MethodHandlers;
use strict;
use warnings;
+ use B::Hooks::EndOfScope;
our ($Declarator, $Offset);
}
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);
- });
+ };
}
}
use Devel::Declare ();
-use Scope::Guard;
{
package MethodHandlers;
use strict;
use warnings;
+ use B::Hooks::EndOfScope;
our ($Declarator, $Offset);
}
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);
- });
+ };
}
}
use Devel::Declare ();
use Test::More qw(no_plan);
-use Scope::Guard;
{
package FoomHandlers;
use strict;
use warnings;
+ use B::Hooks::EndOfScope;
our ($Declarator, $Offset);
}
sub inject_scope {
- $^H |= 0x120000;
- $^H{DD_FOOMHANDLERS} = 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);
- });
+ };
}
package Foo;