From: Robert Thompson <[EMAIL PROTECTED]>
> Look out for a gotcha though:
> 
> "A more serious concern is that unreachable memory with a non-zero
> reference count will not normally get freed. Therefore, this is a bad
> idea:
> 
>     {
>  my $a;
>  $a = \$a;
>     }  
> 
> Even thought $a should go away, it can't. When building recursive data
> structures, you'll have to break the self-reference yourself
> explicitly if you don't care to leak."

It may be hard to break the cycles explicitely.
Sometimes it's better to use so called "weak references".

That is references that do not increase the reference count.

See
        perldoc WeakRef

Jenda

=========== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==========
There is a reason for living. There must be. I've seen it somewhere.
It's just that in the mess on my table ... and in my brain
I can't find it.
                                        --- me


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to