First, I would suggest you use <code> tags round your code. That will make your string look multiline :-). See Writeup Formatting Tips.
To match over multiple lines you need to go into paragrep mode, with $/=undef, then to add the s modifier to the end of your regex. See the "Matching multiple lines" example, here.