froeach my $x (@$array1) { return $x; } foreach my $c (@$array2) { return $c; } print qq($x , $c);