my @join; for my $i (@table1) { for my $j (@table2) { push @join,@$i,@$j; } }