sub display_email { my ($fn) = @_; print "
file $fn
\n"; if ( open EMAIL, $fn ) { print "

\n
";
        $/ = '';
        $header = ;              # slurp entire mail header in
        $header =~ s/\n\s+/ /g;         # merge continuation lines
        foreach $_ ( split "\n", $header ) {
            print "$_\n" unless (
                                /^Message-Id:/
                         ||     /^Content[-\w]*:/
                         ||     /^X-[-\w]*:/
                         ||     /^Status: RO/
                         ||     /^Received:/
                         ||     /^Mime-Version:/ );
        }
        # end of headers, now read and display the body of the email
        $/ = "\n";
        print "\n";
        while(  ) {
            chomp;
            # print lines of the file, line-wrapping at column 80
            while ( length($_) > 80 ) {
                print substr( $_, 0, 80 ), "\n";
                $_ = substr( $_, 80 );
            }
            print "$_\n";
        }
        print "
\n"; close EMAIL; } }