- my $tid = threads->tid();
- my $a = 3;
- my $res = eval { cast $a, $wiz, sub { 5 }->() };
- is($@, '', "cast in thread $tid doesn't croak");
- my $b;
- eval { $b = $a };
- is($@, '', "get in thread $tid doesn't croak");
- is($b, 3, "get in thread $tid returns the right thing");
- my $d = eval { getdata $a, $wiz };
- is($@, '', "getdata in thread $tid doesn't croak");
- is($d, 5 + $tid, "getdata in thread $tid returns the right thing");
- eval { $a = 9 };
- is($@, '', "set in thread $tid (check opname) doesn't croak");
- if ($dispell) {
- $res = eval { dispell $a, $wiz };
- is($@, '', "dispell in thread $tid doesn't croak");
- undef $b;
+ my $tid = threads->tid;
+
+ my $a = 3;
+
+ {
+ local $@;
+ my $res = eval { cast $a, $wiz, sub { 5 }->() };
+ is $@, '', "cast in thread $tid doesn't croak";
+ }
+
+ {
+ local $@;
+ my $b;