1#! /usr/bin/env perl 2 3# eval + Data::Alias + threads == segfault 4# See rt.cpan.org 82922 5# This tests that we at least don't blow up on load of MS. 6 7use strict; 8use warnings; 9 10use Config; 11 12# threads.pm must be loaded before Test::More in order for Test::More 13# to operate properly with threaded tests. 14my $has_threads; 15BEGIN { 16 $has_threads = eval { require threads }; 17} 18use Test::More; 19 20plan skip_all => 'This test only relevant under threaded Perls' if !$has_threads; 21 22use Method::Signatures; 23 24sub worker { 25 pass("Before eval"); 26 eval "1 + 1"; 27 pass("After eval"); 28 return 1; 29} 30 31pass("Creating thread"); 32 33my $thr = threads->create(\&worker); 34$thr->join(); 35 36pass("Threads joined"); 37 38done_testing(4); 39