You may not have more than one line in your target, or you may not have
told Perl to treat your target as having more than one line. If you intend
to do a multiline match, first be sure that you actually have a multiline
string! There are many ways to get multiline data into a string. If you
want it to happen automatically while reading input, you'll want to set $/
(probably to '' or undef) to allow you to read more than one line at a time.
You should also read the perlre manpage and decide which of /s and /m (or both) you might want to use: /s allow dot to include newline, and /m
allows caret and dollar to match next to a newline, not just at the end of
the string. You just need to make you've actually got a multiline string in
there.