Aaron J. Mackey [Fri, 13 Jun 2003 08:22:05 +0000 (04:22 -0400)]
Subject: Re: untie from within FETCH/STORE not working under 5.8.0 (fwd)
Message-ID: <Pine.OSF.4.33.
0306130820570.29017-100000@alpha10.bioch.virginia.edu>
(plus a test case)
p4raw-id: //depot/perl@19793
(UV)SvREFCNT(obj) - 1 ) ;
}
}
- sv_unmagic(sv, how) ;
}
+ sv_unmagic(sv, how) ;
RETPUSHYES;
}
EXPECT
2
3
+########
+# test untie() from within FETCH
+package Foo;
+sub TIESCALAR { my $pkg = shift; return bless [@_], $pkg; }
+sub FETCH {
+ my $self = shift;
+ my ($obj, $field) = @$self;
+ untie $obj->{$field};
+ $obj->{$field} = "Bar";
+}
+package main;
+tie $a->{foo}, "Foo", $a, "foo";
+$a->{foo}; # access once
+# the hash element should not be tied anymore
+print defined tied $a->{foo} ? "not ok" : "ok";
+EXPECT
+ok