in reply to Push hash reference on array problem
#push @dfdata_out, (\%dfdata_row); %dfdata_row = ();
What happens here is that you push into @dfdata_out a reference to the hash %dfdata_row, and then you empty the hash. After that, the reference in @dfdata_out is the same reference pointing to an empty hash. What you probably want to do is:
push @dfdata_out, { %dfdata_row }; %dfdata_row = ();
This is effectively the same as what's working for you now. It copies the old hash to a new (anonymous) hash and pushes a reference to the copy on the list.
You might want to have a look at perlreftut for more.
|
|---|