http://www.perlmonks.org?node_id=17997


in reply to How can I match a multi-line regexp?

You need to tell the regex engine to treat your scalar as a multiline string with the /m option; otherwise it won't attempt to match across newlines. For instance,
$_ = "bunch of stuff\nwith target\nstring inside"; print "Found" if /target\nstring/m;