in reply to mutiple-line regexes?

Shortly, the /m and /s pattern modifiers should help dealing with multi-line mathches.
m Treat string as multiple lines. That is, change "^" and "$" from matching the start or end of the string to matching the start or end of any line anywhere within the string. s Treat string as single line. That is, change "." to match any character whatsoever, even a newline, which normally it would not match.
Read "perldoc perlre" for more information, or post a specific problem.