Mail::M...t::Text(3)
π Mail::M...t::Text β capture a Mail::Message as text
okay bestie so this is a User Contributed Perl Documentation page, filed under Mail::M...t::Text(3) π
and it's literally the glow-up guide for turning a whole message object into plain ol' text. no cap.
πΈ NAME
Mail::Message::Construct::Text β capture a Mail::Message as text β¨
π SYNOPSIS
my $text = $msg->string;
my $text = "$msg"; # via overload
my @text = $msg->lines;
my @text = @$lines; # via overload
my $fh = $msg->file;
my $line = <$fh>;
$msg->printStructure;
like. look at it. it's giving effortless π
π¦ DESCRIPTION
so here's the tea β β complex functionality on Mail::Message objects lives in a bunch of different files, and those files get autoloaded. this particular file implements the functionality related to creating message replies. that's the vibe. that's the whole vibe check. π
π METHODS
π The whole message as text
$obj->file()β hands you the message back as a file-handle. yes, an actual handle. go wild. π₯$obj->lines()β hands you the whole message back as a set of lines. in LIST context you get copies of the lines (not the originals, bestie, copies π«Ά). in SCALAR context you get a reference to an array of lines.$obj->printStructure( [$fh|undef],[$indent] )β prints the structure of a message to the specified$fh, or to the selected filehandle if you didn't say. and when you explicitly passundefas the handle? the output comes back as a string instead. iconic behaviour honestly. β¨
the message's subject and the types of all composing parts get displayed. slay.
$indent is the initial indentation string β it gets added in front of each line. heads up: $indent must contain at least one white-space. fr fr. β οΈ
Β» example:
my $msg = ...;
$msg->printStructure(\*OUTPUT);
$msg->printStructure;
my $struct = $msg->printStructure(undef);
# Possible output for one message:
multipart/mixed: forwarded message from Pietje Puk (1550 bytes)
text/plain (164 bytes)
message/rfc822 (1043 bytes)
multipart/alternative: A multipart alternative (942 bytes)
text/plain (148 bytes, deleted)
text/html (358 bytes)
$obj->string()β returns the whole message as a string. that's it. that's the method. periodt. π
π Flags
ngl bestie, this heading is here and there is nothing under it. it's giving mystery. it's giving main character energy with no dialogue. π but we keep it, because we keep everything.
π SEE ALSO
this module is part of Mail-Message version 4.04, built on February 04, 2026. website: http://perl.overmeer.net/CPAN/ π
π LICENSE
for contributors see file ChangeLog.
this software is copyright (c) 2001-2026 by Mark Overmeer.
this is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
and that's the whole page, bestie β perl v5.42.0, dated 2026-02-05, straight from Mail::M...t::Text(3). ate and left no crumbs. ππ
π¦β¨
π¦ where this page comes from
- fedora 44: perl-Mail-Message 4.04-1.fc44 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms