- or download this
my @list = split /,/, $thestring;
if(grep { $_ == $thecheck } @list) {
...
if($set{$thecheck}) {
print "Found it!\n";
}
- or download this
if($thestring =~ /(?:^|,)$thecheck(?=,|$)/) { ... }
- or download this
if($thestring =~ /(?<![^,])$thecheck(?![^,])/) { ... }