HEX
Server: Apache/2.4.57 (Unix) OpenSSL/1.1.1k
System: Linux tam.zee-supreme-vps.net 4.18.0-513.9.1.el8_9.x86_64 #1 SMP Sat Dec 2 05:23:44 EST 2023 x86_64
User: adltc (1070)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: //usr/share/doc/perl-B-Hooks-EndOfScope/t/02-localise.t
use strict;
use warnings;

use Test::More 0.89;

use B::Hooks::EndOfScope;

{
    my $fired;

    {
        BEGIN { on_scope_end { $fired++ } }

        BEGIN { ok(!$fired) }

        BEGIN { local %^H }

        BEGIN { ok(!$fired) }
    }

    BEGIN { ok($fired) }
}

{
    my $fired;

    {
        BEGIN { on_scope_end { $fired++ } }
        BEGIN { ok(!$fired) }

        BEGIN {
            local %^H;

            my $fired2;
            {
                BEGIN { on_scope_end { $fired2++ } }
                BEGIN { ok(!$fired2) }
                BEGIN { local %^H }
                BEGIN { ok(!$fired2) }
            }
            BEGIN { ok($fired2) }
        }

        BEGIN { ok(!$fired) }
    }

    BEGIN { ok($fired) }
}

done_testing;