Perl uses a reference-counting garbage collection scheme. Declaring the lexical increments the reference counter to one, and storing a reference in the object increments the counter to two. When the @array name goes out of scope, the counter is decremented back to one. Since the object still holds a reference, the actual array data structure will not be garbage collected.
In reply to Re: Storing arrays as object variables
by chromatic
in thread Storing arrays as object variables
by Basilides
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |