#!/usr/bin/perl

$mode = 0;

while (<STDIN>) {
	if (/^##KLUDGES##$|^###MESSAGE_END###$/ && $mode==0) {
		print "\nThe fortune of today:\n---------------------\n";
		open(fort,"fortune -s -o |");
		while ($f = <fort>) { print $f; }
		close fort;
		print "\n";
		$mode=1;
	}
	print
}
