You don't specify if all your hashes will always be in the same order in each array ref. This example code below believes that they will be (which was kind of apparent in your code, but one never knows):
for (0..$#$data1){ if ($data1->[$_]{ACC} eq $data2->[$_]{ACC}){ push @all, { %{ $data1->[$_] }, %{ $data2->[$_] } }; } }
In reply to Re: Merging Data into one array
by stevieb
in thread Merging Data into one array
by Anonymous Monk
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |