Mail::M...::String(3)
π Mail::M...::String(3) π
User Contributed Perl Documentation β yeah bestie, that's the manual name right there: Mail::M...::String(3), straight out of the perl docs, section 3. Buckle up, this one is a long ride and we're only on part one. π
β¨ NAME β¨
Mail::Message::Body::String β the body of a Mail::Message, stored as one single string. That's it. That's the whole vibe. π
π INHERITANCE π
Mail::Message::Body::String
is a Mail::Message::Body
is a Mail::Reporter
Mail::Message::Body also extends Mail::Reporter
is a Mail::Reporter
So it's giving generational trauma in the class hierarchy β this one inherits from Mail::Message::Body, which itself is a Mail::Reporter, and Mail::Message::Body also extends Mail::Reporter. Yes, Mail::Reporter shows up twice. That's not me being messy, that's the actual family tree. π³
π SYNOPSIS π
See Mail::Message::Body
That's the whole synopsis, bestie. No spoilers here, go read the parent class. π
π¦ DESCRIPTION π¦
Okay so β the body (aka the content) of a message can be stored in various ways. This particular page is all about the extra functionality you unlock when a message is stored as a single scalar. π
Storing a whole message in one string is only a smart choice when the content is small, or when it's encoded. And even when it's stored as a scalar, you can still treat the body as if the data lives in lines or in an external file β but heads up, that'll be slower. Not tragic, just slower. β
Extends "DESCRIPTION" in Mail::Message::Body.
π₯ OVERLOADED π₯
Extends "OVERLOADED" in Mail::Message::Body.
- overload:
'""'stringification β inherited, see"OVERLOADED"inMail::Message::Body - overload:
'=='numerical comparison β inherited, see"OVERLOADED"inMail::Message::Body - overload:
'@{}'addressed as array β inherited, see"OVERLOADED"inMail::Message::Body - overload: bool true/false β inherited, see
"OVERLOADED"inMail::Message::Body
All four are inherited, so no new party tricks here, but they're still doing their thing in the background. π
π οΈ METHODS π οΈ
Extends "METHODS" in Mail::Message::Body.
π Constructors π
Extends "Constructors" in Mail::Message::Body.
$obj->clone()β inherited, see"Constructors"inMail::Message::Body$class->new(%options)β inherited, see"Constructors"inMail::Message::Body
And here's the option menu for new(%options), exactly as it comes, no edits, no substitutions:
-Option --Defined in --Default
based_on Mail::Message::Body undef
charset Mail::Message::Body 'PERL'
checked Mail::Message::Body false
content_id Mail::Message::Body undef
data Mail::Message::Body undef
description Mail::Message::Body undef
disposition Mail::Message::Body undef
eol Mail::Message::Body 'NATIVE'
file Mail::Message::Body undef
filename Mail::Message::Body undef
language Mail::Message::Body undef
message Mail::Message::Body undef
mime_type Mail::Message::Body 'text/plain'
modified Mail::Message::Body false
transfer_encoding Mail::Message::Body 'none'
And now, one by one, the values each of those accepts:
based_on => $bodycharset => $charset|'PERL'|<undef>checked => BOOLEANcontent_id => STRINGdata => \@lines|$textdescription => STRING|$fielddisposition => STRING|$fieldeol => 'CR'|'LF'|'CRLF'|'NATIVE'file => $file|$handle|$iofilename => $filelanguage => STRING|\@lang|$fieldmessage => $messagemime_type => STRING|$field|$mimemodified => BOOLEANtransfer_encoding => STRING|$field
Every single one defaults over in Mail::Message::Body, so this class is just vibing on what it inherited. π
π« Attributes π«
Extends "Attributes" in Mail::Message::Body.
$obj->charsetDetectAlgorithm( [CODE|undef|METHOD] )β inherited, see"Attributes"inMail::Message::Body::Encode
π§ Constructing a body π§
Extends "Constructing a body" in Mail::Message::Body.
$obj->attach(@messages, %options)β inherited, see"Constructing a body"inMail::Message::Body::Construct$obj->charsetDetect(%options)β inherited, see"Constructing a body"inMail::Message::Body::Encode$obj->check()β inherited, see"Constructing a body"inMail::Message::Body::Encode$obj->concatenate(@components)β inherited, see"Constructing a body"inMail::Message::Body::Construct$obj->decoded(%options)β inherited, see"Constructing a body"inMail::Message::Body$obj->encode(%options)β inherited, see"Constructing a body"inMail::Message::Body::Encode$obj->encoded(%options)β inherited, see"Constructing a body"inMail::Message::Body::Encode$obj->eol( ['CR'|'LF'|'CRLF'|'NATIVE'] )β inherited, see"Constructing a body"inMail::Message::Body::Encode$obj->foreachLine(CODE)β inherited, see"Constructing a body"inMail::Message::Body::Construct$obj->stripSignature(%options)β inherited, see"Constructing a body"inMail::Message::Body::Construct$obj->unify($body)β inherited, see"Constructing a body"inMail::Message::Body::Encode
π«Ά The body π«Ά
Extends "The body" in Mail::Message::Body.
$obj->isDelayed()β inherited, see"The body"inMail::Message::Body$obj->isMultipart()β inherited, see"The body"inMail::Message::Body$obj->isNested()β inherited, see"The body"inMail::Message::Body$obj->message( [$message] )β inherited, see"The body"inMail::Message::Body$obj->partNumberOf($part)β inherited, see"The body"inMail::Message::Body
πΈ About the payload πΈ
Extends "About the payload" in Mail::Message::Body.
$obj->charset()β inherited, see"About the payload"inMail::Message::Body$obj->checked( [BOOLEAN] )β inherited, see"About the payload"inMail::Message::Body$obj->contentId( [STRING|$field] )β inherited, see"About the payload"inMail::Message::Body$obj->description( [STRING|$field] )β inherited, see"About the payload"inMail::Message::Body$obj->disposition( [STRING|$field] )β inherited, see"About the payload"inMail::Message::Body$obj->dispositionFilename( [$directory] )β inherited, see"About the payload"inMail::Message::Body::Encode$obj->isBinary()β inherited, see"About the payload"inMail::Message::Body::Encode$obj->isText()β inherited, see"About the payload"inMail::Message::Body::Encode$obj->language( [@langs|\@langs|$langs|$field] )β inherited, see"About the payload"inMail::Message::Body$obj->mimeType()β inherited, see"About the payload"inMail::Message::Body$obj->nrLines()β inherited, see"About the payload"inMail::Message::Body$obj->size()β inherited, see"About the payload"inMail::Message::Body$obj->transferEncoding( [STRING|$field] )β inherited, see"About the payload"inMail::Message::Body$obj->type( [STRING|$field] )β inherited, see"About the payload"inMail::Message::Body
π Access to the payload π
Extends "Access to the payload" in Mail::Message::Body.
$obj->endsOnNewline()β inherited, see"Access to the payload"inMail::Message::Body$obj->file()β inherited, see"Access to the payload"inMail::Message::Body$obj->lines()β inherited, see"Access to the payload"inMail::Message::Body$obj->print( [$fh] )β inherited, see"Access to the payload"inMail::Message::Body$obj->printEscapedFrom($fh)β inherited, see"Access to the payload"inMail::Message::Body$obj->string()β inherited, see"Access to the payload"inMail::Message::Body$obj->stripTrailingNewline()β inherited, see"Access to the payload"inMail::Message::Body$obj->write(%options)β inherited, see"Access to the payload"inMail::Message::Body
π§ Internals π§
Extends "Internals" in Mail::Message::Body.
$any->addTransferEncHandler( $name, <$class|$object> )β inherited, see"Internals"inMail::Message::Body::Encode$obj->contentInfoFrom($head)β inherited, see"Internals"inMail::Message::Body$obj->contentInfoTo($head)β inherited, see"Internals"inMail::Message::Body$obj->fileLocation( [$begin, $end] )β inherited, see"Internals"inMail::Message::Body$obj->getTransferEncHandler($type)β inherited, see"Internals"inMail::Message::Body::Encode$obj->isModified()β inherited, see"Internals"inMail::Message::Body$obj->load()β inherited, see"Internals"inMail::Message::Body$obj->modified( [BOOLEAN] )β inherited, see"Internals"inMail::Message::Body$obj->moveLocation( [$distance] )β inherited, see"Internals"inMail::Message::Body$obj->read( $parser, $head, $bodytype, [$chars, [$lines]] )β inherited, see"Internals"inMail::Message::Body
π Error handling π
Extends "Error handling" in Mail::Message::Body.
$obj->AUTOLOAD()β inherited, see"Error handling"inMail::Message::Body$obj->notImplemented()β inherited, see"Error handling"inMail::Reporter$obj->notImplemented()β inherited, see"Error handling"inMail::Reporter
Not me listingnotImplemented()twice. π That's genuinely how it appears in the original β both entries, both pointing atMail::Reporter, both staying. No cap.
π§Ή Cleanup π§Ή
Extends "Cleanup" in Mail::Message::Body.
$obj->DESTROY()β inherited, see"Cleanup"inMail::Reporter$obj->DESTROY()β inherited, see"Cleanup"inMail::Reporter
And yes, DESTROY() is duplicated too. Twice. We don't question the ancestors, we just document them faithfully. π
π DETAILS π
Extends "DETAILS" in Mail::Message::Body.
okay bestie that's the end of part one β there's more coming, don't go anywhere π
π DIAGNOSTICS π
Okay bestie, this is the part where the module talks back. Every single one of these messages is a little love note from the internals, and lowkey you will meet some of them. Here's the full roster, no skips, no cuts:
Warning: Content-Transfer-Encoding '$te' requires explicit charset, defaulted to utf-8.β Cast byencode(). So like, the transfer encoding you picked was being mysterious about its charset, and the module just went "fine, utf-8 it is" without asking you. Rude? A little. Convenient? Also yes.Fault: Unable to read file $name for message body scalar: $!β Cast bynew(). You asked for aMail::Message::Body::Stringbuilt from a named file, but the file said "not today" and could not be read to grab the lines inside. The$!is your error variable telling you why.Error: cannot concatenate element $whichβ Cast byconcatenate(). The concatenation vibe check failed, specifically on the element named by$which.Fault: cannot open $file to write body: $!β Cast bywrite(). Couldn't open that file to write the body into. Check your perms, bestie, and check$!.Warning: charset '$name' is not known.β Cast byencode(). You hit a character set that Perl'sEncodemodule has literally never heard of while encoding or decoding a message body. It's giving "who is she".Error: class $package does not implement method $method.β Cast bynotImplemented(). Fatal error. The specific$package(or one of its superclasses) doesn't implement this method where it really should. Which means some other related classes do implement it, but this one justβ¦ doesn't. Investigate it, and probably tell the author of the package. Fr fr.Error: class $package does not implement method $method.β Cast bynotImplemented(). Fatal error. The specific$package(or one of its superclasses) does not implement this method where it should. This message means that some other related classes do implement this method however the class at hand does not. Probably you should investigate this and probably inform the author of the package. (Yes, it's listed twice in the original β no, I'm not merging them, that would be a crime. π )Fault: error closing $file after write body: $!β Cast bywrite(). The writing went fine, the closing did not. Awkward.Warning: no decoder defined for transfer encoding '$encoding'.β Cast byencode(). Your message body is encoded in a way nothing here understands, so no decoding (and no recoding) can happen. Sorry babe, we're stuck with it as-is.Warning: no encoder defined for transfer encoding '$encoding'.β Cast byencode(). The body got decoded just fine, but the encoding you want is unknown. The decoded data is returned to you anyway, so at least you're not empty-handed. π«ΆError: no filename parameter for write() body.β Cast bywrite(). You calledwrite()with no filename. The body has nowhere to go. It's homeless. Give it a filename.Error: part number needs multi-part or nested.β Cast bypartNumberOf(). You asked for a part number on something that isn't a multi-part and isn't nested. The math cannot math.Error: unknown line terminator '$eol'.β Cast byeol(). That line terminator? Not one it recognizes. Iconic of you to try though.
π 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. Slay. π
And that's the whole page, bestie! π¦ Generated byperl v5.42.0on2026-02-05, for theMail::M...::String(3)manual. Go forth and encode responsibly. Periodt. π πΈ
π¦ 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