in reply to Checking for occurrence in comma separated string

Seems you already received quite a lot of answers. And it all boils down to basically having switched the two variables you are working on. Said this, it seems to me that no one has mentioned yet that if you want to interpolate a variable into a regex, then you should take into account \Q, and possibly, for more complex stuff, \E: read about them in perldoc perle. But then you'd be just checking for the occurrence of a substring in which case I think the regex engine would be optimized away to use (something like) index internally. So why not resorting to it directly?