in reply to multi-line regex again

Your biggest problem is that you are reading a line at a time, but you are asking for a regex match that contains \n in the middle, which won't ever happen. I already node'ed that {grin} in the previous response to your previous post.

Either slurp the file as one long string:

{ local $/; $_ = <MAP>; }
or zip it all together as one long string:
$_ = join "", <MAP>;

-- Randal L. Schwartz, Perl hacker