--- fortunes.wml.orig	2002-12-19 13:32:43.000000000 +0100
+++ fortunes.wml	2002-12-19 13:53:08.000000000 +0100
@@ -7,38 +7,26 @@
 
 <:
 	open(FILE, "fortunes") || die("Cannot open fortunes: $!\n");
-	my $inFortune = 0;
-	while (<FILE>) {
-		chomp;
-		unless ($inFortune) {
-			print '<pre>'."\n";
-			$inFortune = 1;
-		};
-		if ($_ eq '%') {
-			print '</pre>'."\n";
-			print '<HR NOSHADE WIDTH="100%" SIZE="1">'."\n";
-			$inFortune = 0;
-		} else {
-			s/&/&amp;/g;
-			s/</&lt;/g;
-			s/>/&gt;/g;
-			s/"/&quot;/g; #"
-			s/ö/&ouml;/g;
-			s/ä/&auml;/g;
-			s/ü/&uuml;/g;
-			s/ß/&szlig;/g;
-			s/Ö/&Ouml;/g;
-			s/Ä/&Auml;/g;
-			s/Ü/&Uuml;/g;
-			print $_,"\n";
-		};
-	};
+	my $cookies;
+	{
+		local $/;
+		$cookies = <FILE>;
+	}
 	close(FILE);
+
+	$cookies =~ s/&/&amp;/g;
+	$cookies =~ s/</&lt;/g;
+	$cookies =~ s/>/&gt;/g;
+	my @cookies = split (/\n%\n/, $cookies);
+	$cookies = join (qq|</pre>
+<hr noshade width="100%" size="1">
+<pre>|, reverse @cookies);
+	print "<pre>$cookies</pre>\n";
 :>
 
-<center>
+<div align="center">
 [ Download: <a href=fortunes>Textdatei</a>, <a href=fortunes.dat>DAT-Datei</a> für fortune(6) ]
-</center>
+</div>
 <p>
 
 Joey hat auch ein bisschen was gesammelt: <link fortunesinfodrom><URL fortunesinfodrom></link>

