1Mail::Message::ConstrucUts:e:rTeCxotn(t3r)ibuted Perl DoMcauimle:n:tMaetsisoange::Construct::Text(3)
2
3
4
6 Mail::Message::Construct::Text - capture a Mail::Message as text
7
9 my $text = $msg->string;
10 my $text = "$msg"; # via overload
11
12 my @text = $msg->lines;
13 my @text = @$lines; # via overload
14
15 my $fh = $msg->file;
16 my $line = <$fh>;
17
18 $msg->printStructure;
19
21 Complex functionality on Mail::Message objects is implemented in
22 different files which are autoloaded. This file implements the
23 functionality related to creating message replies.
24
26 The whole message as text
27 $obj->file
28 Returns the message as file-handle.
29
30 $obj->lines
31 Returns the whole message as set of lines. In LIST context, copies
32 of the lines are returned. In SCALAR context, a reference to an
33 array of lines is returned.
34
35 $obj->printStructure([FILEHANDLE|undef],[INDENT])
36 Print the structure of a message to the specified FILEHANDLE or the
37 selected filehandle. When explicitly "undef" is specified as
38 handle, then the output will be returned as string.
39
40 The message's subject and the types of all composing parts are
41 displayed.
42
43 INDENT specifies the initial indentation string: it is added in
44 front of each line. The INDENT must contain at least one white-
45 space.
46
47 example:
48
49 my $msg = ...;
50 $msg->printStructure(\*OUTPUT);
51
52 $msg->printStructure;
53
54 my $struct = $msg->printStructure(undef);
55
56 # Possible output for one message:
57 multipart/mixed: forwarded message from Pietje Puk (1550 bytes)
58 text/plain (164 bytes)
59 message/rfc822 (1043 bytes)
60 multipart/alternative: A multipart alternative (942 bytes)
61 text/plain (148 bytes, deleted)
62 text/html (358 bytes)
63
64 $obj->string
65 Returns the whole message as string.
66
67 Flags
69 This module is part of Mail-Box distribution version 2.097, built on
70 January 26, 2011. Website: http://perl.overmeer.net/mailbox/
71
73 Copyrights 2001-2011 by Mark Overmeer. For other contributors see
74 ChangeLog.
75
76 This program is free software; you can redistribute it and/or modify it
77 under the same terms as Perl itself. See
78 http://www.perl.com/perl/misc/Artistic.html
79
80
81
82perl v5.12.3 2011-01-26 Mail::Message::Construct::Text(3)