5 package Test::Scope::Guard;
6 sub new { my ($class, $code) = @_; bless [$code], $class; }
7 sub DESTROY { my $self = shift; $self->[0]->() }
11 print "not " if !$_[0];
13 print " - $_[1]" if defined $_[1];
23 ok( $^C, "Test properly running under minus-c" );
26 use Devel::GlobalDestruction::XS;
29 ok !Devel::GlobalDestruction::XS::in_global_destruction(), "BEGIN is not GD with -c";
34 $foo = Test::Scope::Guard->new( sub {
35 ok( Devel::GlobalDestruction::XS::in_global_destruction(), "Final cleanup object destruction properly in GD" ) or do {