in reply to simple utility method

Three bugs. It doesn't convert the strings to regexps (\Q..\E), it assumes $ means end-of-string (\z), and it just plain doesn't work. Try
print in_array('a', 'b', 'c'); # 1 (b)