}
use Config;
if (! $Config{'useithreads'}) {
- print("1..0 # Skip: Perl not compiled with 'useithreads'\n");
+ print("1..0 # SKIP Perl not compiled with 'useithreads'\n");
exit(0);
}
}
share($sref);
$sobj = $sref;
-threads->new(sub {
+threads->create(sub {
# Bless objects
bless $hobj, 'foo';
bless $aobj, 'bar';
ok(24, ref($$hobj{'scalar'}) eq 'baz', "blessed scalar in hash");
ok(25, ${$$hobj{'scalar'}} eq '3', "blessed scalar in hash contents");
-threads->new(sub {
- # Rebless objects
- bless $hobj, 'oof';
- bless $aobj, 'rab';
- bless $sobj, 'zab';
-
- my $data = $$aobj[0];
- bless $data, 'niy';
- $$aobj[0] = $data;
- $data = $$aobj[1];
- bless $data, 'gnay';
- $$aobj[1] = $data;
-
- $data = $$hobj{'hash'};
- bless $data, 'niy';
- $$hobj{'hash'} = $data;
- $data = $$hobj{'array'};
- bless $data, 'gnay';
- $$hobj{'array'} = $data;
-
- $$sobj = 'test';
- })->join;
+threads->create(sub {
+ # Rebless objects
+ bless $hobj, 'oof';
+ bless $aobj, 'rab';
+ bless $sobj, 'zab';
+
+ my $data = $$aobj[0];
+ bless $data, 'niy';
+ $$aobj[0] = $data;
+ $data = $$aobj[1];
+ bless $data, 'gnay';
+ $$aobj[1] = $data;
+
+ $data = $$hobj{'hash'};
+ bless $data, 'niy';
+ $$hobj{'hash'} = $data;
+ $data = $$hobj{'array'};
+ bless $data, 'gnay';
+ $$hobj{'array'} = $data;
+
+ $$sobj = 'test';
+ })->join();
# Test reblessing
ok(26, ref($hobj) eq 'oof', "hash reblessing does work");
ok(36, ref($$hobj{'scalar'}) eq 'zab', "reblessed scalar in hash");
ok(37, ${$$hobj{'scalar'}} eq 'test', "reblessed scalar in hash contents");
+exit(0);
+
# EOF