#! /usr/bin/perl -w
use diagnostics;
use strict;

my $body = 0;
my $filename = shift;

while (<>)
{
	if (/^<BODY/)
	{
		$body = 1;
		$_ = <>;
		$_ = <>;
		print "<!--#include virtual=\"$filename.header.ssi\" -->\n";
	}
	next unless $body;
	last if /^<\/BODY/;
	print;
}

print "<!--#include virtual=\"footer.ssi\" -->\n";

