Dan Jones wrote:

local $/ = "\n\nFrom ";

$_ = <MAILBOX>;
$_ =~ s/\n\nFrom $//;
ProcMessage($_);

while(<MAILBOX>) {
        $_ =~ s/\n\nFrom $//;
        ProcMessage("From $_");

    if(Pause() == 0) {
        last;
    }
}

close MAILBOX;

sub ProcMessage($){
        my $message = shift;
        print "Message:\n $message \n\n";
}

Seems fine to me. The only concern is paragraphs that start with "From ", without e.g. ">" being prepended to those lines. I suppose you know whether that is an issue to count with.

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to