1 2 3 4 5 6 7 8 9 10 11 12 13
#!/usr/bin/env perl use MIME::Lite::HTML; use HTML::HeadParser; my $mlh = MIME::Lite::HTML->new; my $part=$mlh->parse("http://www.perl-community.de"); print $part->body_as_string; my $hhp = HTML::HeadParser->new; $hhp->parse($part->body_as_string); print $hhp->header('Title');
1 2 3 4 5 6 7
my $body = $part->body_as_string; $body =~ s/\QThis is a multi-part message in MIME format.\E$//; $body =~ s/^$//; $body =~ s/--.+$//; $body =~ s/^Content-Disposition.+$//; $body =~ s/^Content-Transfer-Encoding.+$//; $body =~ s/^Content-Type.+$//;
2013-04-01T10:31:13 GwenDragonbody_as_string hat keinen Fehler. Es liefert den Body und der besteht bei einem Multipart aus MIME-Headern und HTML.