As mentioned, you cannot make a Perl regex ignore a newline in order to patch together a relevant match. What you can do is make it include everything, including newlines, which effectively ignores them (since they are no longer an obstacle to match what you want), and then strip out what you don't want. This can be done with the /s modifier on a regex applied to a scalar containing the file contents:
($raw) = $fileContents =~ m/(.*)/s;
$raw =~ s/\n//g;
This is similar in spirit to untainting data; moreover, this particular regex never has to backtrack.