in reply to Q on HTML::Element recursive lambda comment
As a demonstration, put the above code inside a sub, and then have something that calls that subroutine, say, 16_000_000 times. (Call it on the same very, very small tree - I recommend a tree that's no more than one element in size)
Now try the same thing without the undef.
The difference between the two sets of examples he gives is that the bad examples create a reference from $give_id to itself - that is, they create a recursive data structure. Perl's garbage collector doesn't handle recursive structures, so you shouldn't leave them around after a variable goes out of scope.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Q on HTML::Element recursive lambda comment
by lucylane (Acolyte) on Mar 08, 2004 at 20:08 UTC | |
by fizbin (Chaplain) on Mar 08, 2004 at 20:24 UTC | |
Re: Re: Q on HTML::Element recursive lambda comment
by fizbin (Chaplain) on Mar 08, 2004 at 21:07 UTC |