String $query contains '123'. I'd like to know how to create a match/test so that I get a positive result for things which are in the array @GrpIDs that have an entry in the string $query.
Comment on Re: Do values from string exist within array?
use strict;
use warnings;
use List::MoreUtils qw(any);
my @GrpIDs = qw(123 456);
my $query = '123,567';
my $QUERY = join '|', split(/,/, $query);
if (any {/$QUERY/} @GrpIDs){
print "We have a match\n";
}