On Fri, 4 Jan 2002, Ken Williams wrote:

>
> On Friday, January 4, 2002, at 02:48 AM, Gerald Richter wrote:
>
> >>    # Won't get cleaned up properly
> >>    local %foo;
> >>    tie %foo, 'Dummy', name => '%foo';
> >
> > local only make a copy of the original value and restores it at the end
> > of
> > the scope, so %foo will not destroyed, but restored at the end of the
> > scope.
> > I guess this is the reason my it still stays tied.
>
> AMS just posted this small test case to p5p:
>
>      sub X::TIEHASH{bless{}}
>      { local %x; tie %x, "X" } print tied %x ? "a" : "b";
>
> 5.004_03 prints "b", and 5.004_04 (and higher) prints "a".  I think "b"
> is the proper behavior, at least that's my opinion.

Well, you can say I'm cold-hearted, but I think if you use every feature
Perl has in one line, you can expect trouble.  Apache::Session has a
history of this.  With every Perl < 5.6, it cause a segfault when calling
die() from within TIEHASH.

-jwb

Reply via email to