in reply to Confusion in working upon regex with /m

If I understand correctly, you want to do something like this:

/^abc$\ndef$/

But you are faced with $\ getting treated as a variable name. You could use one of the following instead:

/^abc(?:$)\ndef$/m
/^abc$(?:\n)def$/m
/ ^ abc $ \n def $ /xm
But the following ones are better:
/^abc\ndef$/m
/ ^ abc \n def $ /xm