8 use autovivification::TestThreads;
10 use Test::Leaner tests => 1;
14 skip 'Fails on 5.8.2 and lower' => 1 if "$]" <= 5.008_002;
16 my $status = run_perl <<' RUN';
19 $code -= threads->create(sub {
20 eval q{no autovivification; my $x; my $y = $x->{foo}; $x};
21 return defined($x) ? 0 : 1;
23 $code -= defined(eval q{my $x; my $y = $x->{foo}; $x}) ? 2 : 0;
24 $code -= defined(eval q{no autovivification; my $x; my $y = $x->{foo}; $x})
28 is $status, 0, 'loading the pragma in a thread and using it outside doesn\'t segfault';