MIME::Parser 5.420
Sponsored Links
MIME::Parser 5.420 Ranking & Summary
File size:
0.38 MB
Platform:
Any Platform
License:
Perl Artistic License
Price:
Downloads:
1075
Date added:
2006-11-17
Publisher:
Eryq, ZeeGee Software Inc and David F. Skoll
MIME::Parser 5.420 description
MIME::Parser is a experimental class for parsing MIME streams.
SYNOPSIS
Before reading further, you should see MIME::Tools to make sure that you understand where this module fits into the grand scheme of things. Go on, do it now. Ill wait.
Ready? Ok...
Basic usage examples
### Create a new parser object:
my $parser = new MIME::Parser;
### Tell it where to put things:
$parser->output_under("/tmp");
### Parse an input filehandle:
$entity = $parser->parse(*STDIN);
### Congratulations: you now have a (possibly multipart) MIME entity!
$entity->dump_skeleton; # for debugging
Examples of input
### Parse from filehandles:
$entity = $parser->parse(*STDIN);
$entity = $parser->parse(IO::File->new("some command|");
### Parse from any object that supports getline() and read():
$entity = $parser->parse($myHandle);
### Parse an in-core MIME message:
$entity = $parser->parse_data($message);
### Parse an MIME message in a file:
$entity = $parser->parse_open("/some/file.msg");
### Parse an MIME message out of a pipeline:
$entity = $parser->parse_open("gunzip - < file.msg.gz |");
### Parse already-split input (as "deliver" would give it to you):
$entity = $parser->parse_two("msg.head", "msg.body");
Examples of output control
### Keep parsed message bodies in core (default outputs to disk):
$parser->output_to_core(1);
### Output each message body to a one-per-message directory:
$parser->output_under("/tmp");
### Output each message body to the same directory:
$parser->output_dir("/tmp");
### Change how nameless message-component files are named:
$parser->output_prefix("msg");
Examples of error recovery
### Normal mechanism:
eval { $entity = $parser->parse(*STDIN) };
if ($@) {
$results = $parser->results;
$decapitated = $parser->last_head; ### get last top-level head
}
### Ultra-tolerant mechanism:
$parser->ignore_errors(1);
$entity = eval { $parser->parse(*STDIN) };
$error = ($@ || $parser->last_error);
### Cleanup all files created by the parse:
eval { $entity = $parser->parse(*STDIN) };
...
$parser->filer->purge;
Examples of parser options
### Automatically attempt to RFC-1522-decode the MIME headers?
$parser->decode_headers(1); ### default is false
### Parse contained "message/rfc822" objects as nested MIME streams?
$parser->extract_nested_messages(0); ### default is true
### Look for uuencode in "text" messages, and extract it?
$parser->extract_uuencode(1); ### default is false
### Should we forgive normally-fatal errors?
$parser->ignore_errors(0); ### default is true
Miscellaneous examples
### Convert a Mail::Internet object to a MIME::Entity:
@lines = (@{$mail->header}, "n", @{$mail->body});
$entity = $parser->parse_data(@lines);
SYNOPSIS
Before reading further, you should see MIME::Tools to make sure that you understand where this module fits into the grand scheme of things. Go on, do it now. Ill wait.
Ready? Ok...
Basic usage examples
### Create a new parser object:
my $parser = new MIME::Parser;
### Tell it where to put things:
$parser->output_under("/tmp");
### Parse an input filehandle:
$entity = $parser->parse(*STDIN);
### Congratulations: you now have a (possibly multipart) MIME entity!
$entity->dump_skeleton; # for debugging
Examples of input
### Parse from filehandles:
$entity = $parser->parse(*STDIN);
$entity = $parser->parse(IO::File->new("some command|");
### Parse from any object that supports getline() and read():
$entity = $parser->parse($myHandle);
### Parse an in-core MIME message:
$entity = $parser->parse_data($message);
### Parse an MIME message in a file:
$entity = $parser->parse_open("/some/file.msg");
### Parse an MIME message out of a pipeline:
$entity = $parser->parse_open("gunzip - < file.msg.gz |");
### Parse already-split input (as "deliver" would give it to you):
$entity = $parser->parse_two("msg.head", "msg.body");
Examples of output control
### Keep parsed message bodies in core (default outputs to disk):
$parser->output_to_core(1);
### Output each message body to a one-per-message directory:
$parser->output_under("/tmp");
### Output each message body to the same directory:
$parser->output_dir("/tmp");
### Change how nameless message-component files are named:
$parser->output_prefix("msg");
Examples of error recovery
### Normal mechanism:
eval { $entity = $parser->parse(*STDIN) };
if ($@) {
$results = $parser->results;
$decapitated = $parser->last_head; ### get last top-level head
}
### Ultra-tolerant mechanism:
$parser->ignore_errors(1);
$entity = eval { $parser->parse(*STDIN) };
$error = ($@ || $parser->last_error);
### Cleanup all files created by the parse:
eval { $entity = $parser->parse(*STDIN) };
...
$parser->filer->purge;
Examples of parser options
### Automatically attempt to RFC-1522-decode the MIME headers?
$parser->decode_headers(1); ### default is false
### Parse contained "message/rfc822" objects as nested MIME streams?
$parser->extract_nested_messages(0); ### default is true
### Look for uuencode in "text" messages, and extract it?
$parser->extract_uuencode(1); ### default is false
### Should we forgive normally-fatal errors?
$parser->ignore_errors(0); ### default is true
Miscellaneous examples
### Convert a Mail::Internet object to a MIME::Entity:
@lines = (@{$mail->header}, "n", @{$mail->body});
$entity = $parser->parse_data(@lines);
MIME::Parser 5.420 Screenshot
MIME::Parser 5.420 Keywords
MIME
STDIN
Parser 5.420
parse
entity
output
message
examples
default
MIME::Parser
MIMEParser
MIME::Parser 5.420
Libraries
Programming
Bookmark MIME::Parser 5.420
MIME::Parser 5.420 Copyright
WareSeeker periodically updates pricing and software information of MIME::Parser 5.420 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of MIME::Parser 5.420 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed
Featured Software
Want to place your software product here?
Please contact us for consideration.
Contact WareSeeker.com
Related Information
Related Software
MIME::Words is a Perl module to deal with RFC-1522 encoded words. Free Download
MIME::Head is a MIME message header (a subclass of Mail::Header). Free Download
MIME::WordDecoder is a Perl module to decode RFC-1522 encoded words to a local representation. Free Download
MP3::M3U::Parser is a MP3 playlist parser. Free Download
Test::Parser is a collection of parsers for different test output file formats. Free Download
CQL::Parser is a Perl module that compiles CQL strings into parse trees of Node subtypes. Free Download
MIME::Charset module contains charset informations for MIME. Free Download
SVG::Parser is a Perl module with XML Parser for SVG documents. Free Download
Latest Software
Popular Software
Favourite Software