--- Perrin Harkins <[EMAIL PROTECTED]> wrote:
> On 5/11/07, James. L <[EMAIL PROTECTED]> wrote:
> On 5/10/07, Andy Armstrong <[EMAIL PROTECTED]> wrote:
> > Unless I'm misunderstanding you that's not true.
> When a value's
> > reference count goes to zero the memory is freed -
> at least to Perl
> > if not to the OS.
>
> No, it's not. I know it's counter-intutive, but
> this is a feature of
> Perl, and the behavior has been discussed and
> confirmed a number of
> times, both on this list and on perlmonks.org.
>
> - Perrin
>
> > hm. lexical variable release memory to perl. but
> > reference doesn't..
>
> No, that isn't what I was saying, and you're mixing
> separate concepts
> together. A lexical variable can be a reference.
> You can have a
> reference to a lexical variable. They are not
> opposing things.
>
sorry, i wasn't clear. I understand that memory
allocated by a lexical variable(not reference) can be
released to perl. as described by the practical
modperl link you posted.
I would expect that both behave the same however you
are saying a reference won't release memory back to
Perl.
> The p5p references already posted in this thread are
> the best place to
> read up if you want more information about the
> memory behavior of
> Perl's garbage collection.
>
i have read the posted p5p link but the example is
refering to non reference lexical variable.
> - Perrin
>
thanks,
James.
____________________________________________________________________________________
Park yourself in front of a world of choices in alternative vehicles. Visit the
Yahoo! Auto Green Center.
http://autos.yahoo.com/green_center/