Mail::Mbox::MessageParser::Perl3pm
A perl-based mbox folder reader
Usage
#!/usr/bin/perluse Mail::Mbox::MessageParser;my $filename = 'mail/saved-mail';my $filehandle = new FileHandle($filename);my $folder_reader =new Mail::Mbox::MessageParser( {'file_name' => $filename,'file_handle' => $filehandle,} );die $folder_reader unless ref $folder_reader;# Any newlines or such before the start of the first emailmy $prologue = $folder_reader->prologue;print $prologue;# This is the main loop. It's executed once for each emailwhile(!$folder_reader->end_of_file());{my $email = $folder_reader->read_next_email();print $$email;}
Overview
This module implements a Perl-based mbox folder reader. Users must not instantiate this class directly--use Mail::Mbox::MessageParser instead. The base MessageParser module will automatically manage the use of faster implementations if they can be used.
Methods and functions
The following methods and functions are specific to the Mail::Mbox::MessageParser::Perl package. For additional inherited ones, see the Mail::Mbox::MessageParser documentation.
- $ref = new( { 'file_name' => <mailbox file name>, 'file_handle' => <mailbox file handle> });
-
<file_name> - The full filename of the mailbox<file_handle> - An opened file handle for the mailboxThe constructor for the class takes two parameters. The optional file_name parameter is the filename of the mailbox. The required file_handle argument is the opened file handle to the mailbox.
Returns a reference to a Mail::Mbox::MessageParser object, or a string describing the error.
end_of_file()
reset()
read_next_email()-
These methods are overridden in this subclass of Mail::Mbox::MessageParser.
Releases
11 releases since Debian 3.1 (Sarge); the text changed 6 times.