if ($str =~ /jeff/) { ... } # why not if (index($str,'jeff') > -1) { ... } # or if you know that if it's there, it's toward the end: if (rindex($str,'jeff') > -1) { ... }