Sorry, This will return a true value even if the search string is embedded in another string. index ("Hello World", "Wor") will return not return -1, eventhough that may not be what you wanted. Try if ($string_from_file =~ m/\b$search_string\b/) This may be the one you are looking for
hth, Sudarsan Sudarsan Raghavan wrote: > Use index (preldoc -f index). > index ($str_from_file, $search_string); > This will return a -1 if $search_string is not present in $str_from_file. > > hth, > Sudarsan > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]