This line sets the variable buffer to everything in between the "</HEAD>" tag and the </BODY> tag in a file.
$buffer =~ m/<\/HEAD>(.*)<\/BODY>/is;
I have a problem in that some of my documents don't have </BODY> tags and some do... I need the line to do this (here is the english)
$buffer is equal to all text in between the </HEAD> tag and either the </BODY> tag, if there is one OR this string: /commonfooter.cgi