How about if you try what I've written below. What I've done is open the file first, then assign the contents to your header or footer. I've also put in $! after "couldn't parse" so we can see exactly what is going wrong.
Can you try that, and tell me what it says?
open (TXTFILE, "C:/My Documents/carlist/carlist_test/template/ccheader
+.html");
$header_html = <TXTFILE>;
close(TXTFILE);
open (TXTFILE, "C:/My Documents/carlist/carlist_test/template/ccfooter
+.html");
$footer_html = <TXTFILE>;
close(TXTFILE);
if($content=~m|<BODY.*?>(.*?)</BODY>|si) {
$content = $header_html . $1 . $footer_html;
$content =~ s|%title%|$title|;
&save_file("$fullpath",$content);
print "Completed\n";
} else{
print "Couldn't parse: $!\n";
}