On Mon, May 03, 2010 at 05:27:56PM +0100, Dave Mitchell wrote: > On Thu, Apr 29, 2010 at 10:51:26AM -0700, Eric Brine via RT wrote: > > A simpler demonstration: > > > > ---- BEGIN CODE ---- > > #!/usr/bin/env perl > > > > use strict; > > use warnings; > > > > { > > package Tie; > > sub TIESCALAR { return bless({}, shift); } > > sub STORE { next; } > > } > > > > tie my $x, Tie::; > > { tied($x)->STORE(123); } # warns, but works > > { $x = 123; } # warns and dies > > ---- END CODE ---- > > I think this behaviour is correct. Tied method calls shouldn't consider > any context outside the method call itself. After all, the tied action > could have been invoked from almost anywhere, including somewhere deep > within XS code. > > I also think the behaviour is deliberate. Magic method calls are run on a > new set of stacks, and while die etc will pop back across multiple > context stacks, pp_next etc only look at the current stack. Yes, your explanation makes sense. I can't really see that this can be "fixed". Nicholas ClarkThread Previous | Thread Next