#!/usr/bin/perl

my $inputfilename = shift;

open(FILES, $inputfilename) or die "Can't open original inputfile";
while(<FILES>) {
chomp;
$filename = $_;
open(INPUT, $filename) or die "Can't open inputfile $filename!";

my $document = '';
while(<INPUT>) {
	chomp;
	$document = $document . $_;	
	if(/<\/html>/)  { print "$document\n"; $document = '';}
}
close INPUT;

}
