http://qs1969.pair.com?node_id=384089


in reply to Re: regex match with interpolated pattern
in thread regex match with interpolated pattern

You're date variable is using / as the delimiter. As a result you aren't matching the pattern you think you are. You could just use a different delimiter for your pattern.
if ($_ = m%$dm%) { #stuff }
If you are interpolating a string it does not matter if it has characters that are the same as the delimiter. The boundaries of the regex are determined before the interpolation is done. Try this:
perl -e '$string = "/"; print "08/14/04"=~/$string/ ? "matched\n" : "no match\n"'