my $string = "ABCDEFGHIJKLMNOPCDEFQRST"; my $find="CDEF"; print "'$find' string found" if ($string =~ /$find/);