Your problem is a result of
. matching every
character but newline, except if the
/s option is used. See
perlre for more details.
Fixing this morphs your code into:
$content =~ s#.*<h1>Random Movie Quote</h1>(.*)<P><form method=get act
+ion="/Games/randomquote.html">.*#$1#s;
However, for extracting a string from some text, you are
better off matching and just using the extracted string,
rather then trying to substitute out everything else
in one step:
if ($content =~ m#<h1>Random Movie Quote</h1>(.*)<P><form method=get a
+ction="/Games/randomquote.html>#s)
$content = $1; # we matched, replace $content with $1.
# though it might be clearer to put it
# in a different variable.
} else {
# we didn't match, complain.
}
(Note that similarly you can check the return value
of s/// to see if a substitution actually
took place.)