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.


  -Ken

Reply via email to