if( index($str1, $str2) > -1 && $str1 ne $str2 ){ print "$str2 is a substring of $str1\n"; }