[ale] Easy way to cut body of email in perl

fletch at phydeaux.org fletch at phydeaux.org
Thu Jan 5 08:37:25 EST 2006


>> In this case, sure.  In general, no since there's no guaranteed ordering
>> of headers.
>> Safest bet would be to use Mail::Internet or the like and let that parse
>> things.
>
> It's been a while since i was manually deconstructing mail, but IIRC
> there's a blank line between headers and body ... and between messages.

Sure.  Not that it's not trivial to separate the two.

my( $headers, $body );
while( <> ) {


But then you've got to do grunt work such as parsing the headers yourself.
 Much simpler just to use a well tested module and be done with it.

-- 
Fletch                | "If you find my answers frightening,       __`'/|
fletch at phydeaux.org|  Vincent, you should cease askin'          \ o.O'
                      |  scary questions." -- Jules                =(___)=
                      |                                               U





More information about the Ale mailing list