in reply to Array of arrays & references
In the first snippet you actually push a reference to @t_arr2 into @t_arr. If you modify @t_arr2 later those changes will also propagate to all places where @t_arr2 is referenced, such as @t_arr. That's the nature of references.
The second snippet pushes an anonymous array reference, which is a copy of @t_arr2, into @t_arr. Therefor @t_arr doesn't get changed when changing @t_arr2
Cheers, Flo
|
|---|