in reply to Checking for occurrence in comma separated string

I think you want that the other way around:
if($thestring =~ /$thecheck/) { ... }