$mytarget = "I am a perl program"; $mystring = "Perl"; if ($mytarget =~ m/$mystring/i) { print "It matches\n"; } else { print "It doesn't match\n"; }