8 use indirect::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';
17 my ($code, @expected);
22 sub cb { --$code if $_[0] eq shift(@expected) || q{DUMMY} }
24 $code = threads->create(sub {
25 eval q{return; no indirect hook => \&cb; new X;};
29 eval q{return; no indirect hook => \&cb; new Z;};
32 is $status, 0, 'loading the pragma in a thread and using it outside doesn\'t segfault';