You mean like this?
push @z, (grep { $_ ~~ \@y } @x) ? 'y' : 'n';
Shifting some of that into a sub might make it a little more readable...
sub arrays_intersect { grep { $_ ~~ $_[1] } @{$_[0]} }
push @z, arrays_intersect(\@x, \@y) ? 'y' : 'n';
Or you could use Set::Scalar...
my $x_set = Set::Scalar->new(@x);
my $y_set = Set::Scalar->new(@y);
push @z, $x_set->intersection($y_set)->empty ? 'n' : 'y';
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'