#!/usr/bin/perl

use strict;
use diagnostics;

my $all;
my $charset="";
my $heisetext="";
my $heisetext2="";

while (<>) {
        chomp;
        $all.="$_ ";
}
($charset) = ($all =~ /.*(\<meta [^\>]*charset=[^\>]*\>).*/i);
($heisetext) = ($all =~ /.*\<HEISETEXT\>(.*)\<\/HEISETEXT\>.*/i);
($heisetext2) = ($all =~ /.*\<!-- Meldung --\>(.*)\<!-- untere News-Navigation --\>.*/i);

if ($heisetext2) {
	$heisetext=$heisetext2;
}else{
	if ($heisetext =~ /\<!-- Navi Anfang--\>/) {
		($heisetext) = ($heisetext =~ /.*\<h3\>(.*)\<!-- Navi Anfang--\>.*/i);
		$heisetext="<h3>" . $heisetext;
	}
}

unless ( $charset ) { $charset = "" ; }
print "<html><head>" . $charset . "</head><body>" . $heisetext . "</body></html>\n";
