in reply to Re: Combining two references
in thread Combining two references

my $row2=@$data2[$i];

That way of accessing a single element of an array is usually discouraged unless you know what you're doing. Better is $data2->[$i].