[Israel.pm] reference to tied variables

Moshe Kaminsky kaminsky at math.huji.ac.il
Thu Jul 15 12:50:54 PDT 2004


Hi,

Please consider the following code segment:

====8<=====
{
    tie my $Foo, Momo;
    $Bar = \$Foo;
}
$$Bar = 4;
print $$Bar, "\n";
====>8=====

Surprisingly, this actually works (ie, whatever magic Momo introduces 
applies in the assignment and printing). My question is first whether it 
is intentional, and if so, how do I untie whatever is tied now, and when 
the controlling object gets destroyed.

The reason I ask is that I managed to apply this nicely by combining it 
with overloading, and all works fine until I get to the destruction of 
the controlling object, where I see very weird things that I can only 
describe as a bug.

Thanks,
Moshe

-- 
I love deadlines. I like the whooshing sound they make as they fly by. 
                                        -- Douglas Adams
    
    Moshe Kaminsky <kaminsky at math.huji.ac.il>
    Home: 08-9456841
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://perl.org.il/pipermail/perl/attachments/20040715/4c3d9985/attachment.pgp 


More information about the Perl mailing list