The first [<STDIN>] will read in the whole message and create a list of all the lines. Any "From:" lines that are found in the body are going to be counted as header "FromL" lines, so the parser creates an array of all of them.my $msg = Mail::MboxParser::Mail->new([<STDIN>],[<STDIN>]);
There are several solutions. You could do this:
or the more memory-efficient:my $msgtext; { local $/; $msgtext = <STDIN> } my ($header, $body) = split /\n\r?\n/, $msgtext, 2; my $msg = Mail::MboxParser::Mail->new($header, $body);
If you wanted the body, you could change that last line to:my @headerlines; while (<STDIN>) { last if /^\r?\n/; push @headerlines, $_; } my $msg = Mail::MboxParser::Mail->new(\@headerlines, "");
I should say that most subscription processes require some specific code in the body and for good reason. For example, the "reply" you get may be just a vacaction message. Also, people could maliciously sign up others for a subscription just by sending two messages with the same forged "From:" line.my $msg = Mail::MboxParser::Mail->new(\@headerlines, [<STDIN>]);
In reply to Re: Outlook Express Reply Function
by Thelonius
in thread Outlook Express Reply Function
by devslashneil
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |