in reply to Re^4: Strange hash array behavior
in thread Strange hash array behavior

my @array; foreach (0..2) { my $d = $data1->[$_]; $d->{sizes} = $data2; push(@array,$d); } print Dumper(\@array);

The underlying problem is that you think $data2 contains a hash or array (depending on the snippet), but it doesn't. It contains a reference to a hash an an array.

When you assign $data2 to something, you're copying the reference, that's it. All your questions boil down to "Why doesn't copy the referenced hash or array?", and the answer is always "Because you didn't ask it to."