#! /usr/local/bin/perl
format top =
Post Date	  Lines Poster	     Subject
---- ------------ ----- ------------ ------------------------------------------
.
format STDOUT =
@>>> @<< @>, @<<< @>>>> @<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$num, $date[1], $date[2], $date[4], $lines, $from, $subject
.
while(<>) {
  /^--------------- / && do {
    s/^.*#//;
    s/ -+$//;
    $num = $_;
    <>;
    while(<>) {
      /^Date: /i && do {
	s/^Date: +//i;
	s/ +$//;
	s/.*, //;
	chop;
	@date = split(" ");
	next;
      };
      /^From: /i && do {
	s/^From: +//i;
	chop;
	s/^.*<//; s/>.*$//;
	s/ +$//;
	$from = $_;
	next;
      };
      /^Subject: /i && do {
	s/^Subject: +//i;
	s/ +$//;
	chop;
	$subject = $_;
	next;
      };
      /^Lines: /i && do {
	s/^Lines: +//i;
	chop;
	$lines = $_;
	next;
      };
      last if /^$/;
    };
    write;
  };
};
