use strict; 3 my $var1 = "a+b"; 4 my $var2 = "a+b"; 5 if ($var1 =~ /\Q$var2\E/) { 6 print "hey it matches \n"; 7 } 8 9 print "hey here \n"; 10