in reply to Re: Need to grep for a string that ends with $$
in thread Need to grep for a string that ends with $$

The OP said that $matchmember ends with $$, not that $target must end with $matchmember.

That means the "$" shouldn't be there.

if ($target =~ /\Q$matchmember\E/) { print "Match!\n"; }

And since the \E is trailing, it can be omitted.

if ($target =~ /\Q$matchmember/) { print "Match!\n"; }

Finally, he asked to find all occurrences, so it would be more like:

my @matches = $target =~ /(\Q$matchmember\E)/g;

or

while ($target =~ /(\Q$matchmember\E)/g) { print "Found $1 at $-[1]\n"; }