in reply to Re: Re: dereferencing nightmares...
in thread dereferencing nightmares...
Perhaps this is beating a dead horse, but it appears you've hit upon what cLive ;-) apparently originally meant to do with this.
$page_graphic->[$i]->{array} = [@array];By specifying the square brackets around @array, assigning a reference to an anonymous array containing copies of the elements of @array.
No need of correction (IMHO), since cLive ;-) didn't give us the full context of his code (i.e., how is @array populated?), although declaring @array with my within the loop and using \ to take a reference to it is a perfectly valid Way To Do It.
Generally, though, taking references to named array and/or hash variables within a loop raises a red flag with me.
dmm
You can give a man a fish and feed him for a day ...
|
|---|