in reply to How can I find the first position of a substring case-insensitively?

How about a regex?
if ($mystr =~ /(?=a)/gi) { $position = pos($mystr); }
I use a positive lookahead assertion so that pos() will correspond to the start of the match, rather than the end.