$var1 = 'test'; $var2 = '$var1' $string = 'test'; print "Match\n" if $string =~ m/$var2/;