I know that it is easy to match anything except a given character using a regular expression.
$text = \"ab ac ad\"; $text =~ s/[^c]*//g; # Match anything, except
you can use index()
$text = "ab ac ad"; print "ac not found" if ( index($text,"ac") == -1 );