cpanel / perl-compiler

cPanel's custom implementation of B::C
https://cpanel.net
Other
8 stars 3 forks source link

op/sub.t - state variable not working #56

Open toddr opened 7 years ago

toddr commented 7 years ago

Should print ok...


sub predeclared {
    CORE::state $x = 42;
    sub inside_predeclared {
    eval '$x' eq 42 and print "ok\n";
    }
}
predeclared(); # set $x to 42
$main::x = $main::x = "You should not see this.";
inside_predeclared(); # run test