my $msgtext; { local $/; $msgtext = } my ($header, $body) = split /\n\r?\n/, $msgtext, 2; my $msg = Mail::MboxParser::Mail->new($header, $body);