$ perl if ( '_$x_' =~ '$x') { print "match 1" } if ( '_$x_' =~ /\$x/){ print "match 2" } __DATA__ match 2