Perl - MIME::Parser

perl

my $parser = new MIME::Parser;
$parser->output_under('/tmp');
$parser->ignore_errors(1);
$parser->decode_headers(1);     // default is false.  Automatically attempt RFC-1552
                        // to decode the MIME headers

$parser->extract_nested_message(0);        // default is true
$parser->extract_uuencode(1);            // default is false.  Look for uuencode in "text" messages and extract it.

eval {
    $entity = $parser->parse(\*STDIN);
};
if ($@) {
    $result = $parser->results;
    $decapitated = $parser->last_head; // get the last top-level head
}
$entity->output_dir();

$parser->last_error;
$parser->filer->purge;
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License