Use a regular expression with the \b assertion (which matches at word boundries) before and after the word you want to match ...
if ( $text =~ /\bindia\b/ ) { # ... };
--k.
In reply to Re: finding whole words in a string
by Kanji
in thread finding whole words in a string
by mumphis
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |