1Mail::Mbox::MessageParsUesre:r:PCeornlt(r3i)buted Perl DMoaciulm:e:nMtbaotxi:o:nMessageParser::Perl(3)
2
3
4
6 Mail::Mbox::MessageParser::Perl - A Perl-based mbox folder reader
7
9 #!/usr/bin/perl
10
11 use Mail::Mbox::MessageParser;
12
13 my $filename = 'mail/saved-mail';
14 my $filehandle = new FileHandle($filename);
15
16 my $folder_reader =
17 new Mail::Mbox::MessageParser( {
18 'file_name' => $filename,
19 'file_handle' => $filehandle,
20 } );
21
22 die $folder_reader unless ref $folder_reader;
23
24 # Any newlines or such before the start of the first email
25 my $prologue = $folder_reader->prologue;
26 print $prologue;
27
28 # This is the main loop. It's executed once for each email
29 while(!$folder_reader->end_of_file());
30 {
31 my $email = $folder_reader->read_next_email();
32 print $email;
33 }
34
36 This module implements a Perl-based mbox folder reader. Users must not
37 instantiate this class directly--use Mail::Mbox::MessageParser instead.
38 The base MessageParser module will automatically manage the use of
39 faster implementations if they can be used.
40
41 METHODS AND FUNCTIONS
42 The following methods and functions are specific to the
43 Mail::Mbox::MessageParser::Perl package. For additional inherited ones,
44 see the Mail::Mbox::MessageParser documentation.
45
46 $ref = new( { 'file_name' => <mailbox file name>, 'file_handle' =>
47 <mailbox file handle> });
48 <file_name> - The full filename of the mailbox
49 <file_handle> - An opened file handle for the mailbox
50
51 The constructor for the class takes two parameters. The optional
52 file_name parameter is the filename of the mailbox. The required
53 file_handle argument is the opened file handle to the mailbox.
54
55 Returns a reference to a Mail::Mbox::MessageParser object, or a
56 string describing the error.
57
59 No known bugs.
60
61 Contact david@coppit.org for bug reports and suggestions.
62
64 David Coppit <david@coppit.org>.
65
67 This software is distributed under the terms of the GPL. See the file
68 "LICENSE" for more information.
69
71 This code was originally part of the grepmail distribution. See
72 http://grepmail.sf.net/ for previous versions of grepmail which
73 included early versions of this code.
74
76 Mail::Mbox::MessageParser
77
78
79
80perl v5.12.0 2009-08-09Mail::Mbox::MessageParser::Perl(3)