[Israel.pm] reference to tied variables

Yuval Yaari yuval at windax.com
Thu Jul 15 13:25:12 PDT 2004


No offense, but are you aware of what references are and what they mean?
Get a book like "Advanced Perl Programming" and look for the nice
graphical explanation; means more than a 1000 words...
Seriously...
In case you have APP - pages 7, 14, 17 (this book is GREAT, get it if you
don't have it, as you see I always keep it near my computer).

As for untie - you said it yourself: perldoc -f untie

Keep us updated, good luck.

  --Yuval


Moshe Kaminsky said:
> 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






More information about the Perl mailing list