I have an html file stored as a variable $template with the following in it
<!-- MEMBERSHIPS -->
.
a bunch of stuff
.
<!-- BANQUET -->
I would like to replace all of this with something else under certain conditions. Seems simple. However, the following
$template=~s/<!-- MEMBERSHIPS -->(.*?)<!-- BANQUET -->/$paidstring/i;
where $paidstring is what I want to replace it with, seems not to work. Furthermore, I did some playing around, and found that both
/<!-- MEMBERSHIPS -->(.*?)/
and
/(.*?)<!-- BANQUET -->/
will match just fine, but putting everything together shows no match.
What is going on here? Is there something I am missing in attempting to search and replace text between two html comments?