Help for this page

Select Code to Download


  1. or download this
    push @z, (grep { $_ ~~ \@y } @x) ? 'y' : 'n';
    
  2. or download this
    sub arrays_intersect { grep { $_ ~~ $_[1] } @{$_[0]} }
    push @z, arrays_intersect(\@x, \@y) ? 'y' : 'n';
    
  3. or download this
    my $x_set = Set::Scalar->new(@x);
    my $y_set = Set::Scalar->new(@y);
    push @z, $x_set->intersection($y_set)->empty ? 'n' : 'y';