perl check if a string contains substring code example
Example: Perl search if variable contains word
if (index($str, $substr) != -1) {
print "$str contains $substr\n";
}
if (index($str, $substr) != -1) {
print "$str contains $substr\n";
}