in reply to Regular Expressions

your $string =~ has an incomplete s/// ... As for the regex, tlm's is good, making the .* non-greedy (otherwise you'll suck everything through to the </html>), and adding the /s modifier to treatt he entire multiline string as a single string (it makes . match anything, including newlines). perldoc perlre will explain those in further detail. So something like:
$string =~ s/(<body\s.*?>)/$1$newContent/is;
But yeah, if if this isn't just a one-time quick & dirty thing, or if you need this kind of thing for other tags, definitely go with tlm's suggestion of HTML::Parser (the example of finding the <title> tag might be a good starting ppoint, depending on what your needs are) or similar..