Object-InsideOut - Re: How To Deal With Arrays Passed Into Objects During Initialization

Posted on Thu Dec 1 17:59:37 2005 by jdhedden in response to 1428 (See the whole thread of 6)
Re: How To Deal With Arrays Passed Into Objects During Initialization
> However, since I created the array copy inside of a
> subroutine and declared it with my, doesn't the actual
> array that I'm pointing to get garbage collected after
> that subroutine ends? Won't I rapidly risk pointing to
> garbage when _init ends?

When you store a reference to a local (i.e., my) variable, the data persists beyond the original scope. See 'perldoc perlref' for more information on this.

Write a response