Courri...ltipart(3pm)
π Courriel::Part::Multipart β bestie, it's the part that holds other parts
okay so picture this: this is a page from the User Contributed Perl Documentation, manual section 3pm, and the module is Courriel::Part::Multipart. She's a part. But she's a part who contains parts. Mother energy, honestly. π
β¨ VERSION β¨
version 0.49 π
πΈ SYNOPSIS πΈ
my $headers = $part->headers;
my $ct = $part->content_type;
for my $subpart ( $part->parts ) { ... }
look at her go π¦
π DESCRIPTION π
This class represents a multipart email part which contains other parts. That's it, that's the whole vibe. She's the group chat, and every other part is a member of the group chat. π
π API π
This class provides the following methods:
Courriel::Part::Multipart->new( ... )
This method creates a new part object. She takes the following parameters, and you will be hearing about all of them:
partsβ an array reference of part objects (either Single or Multipart). This is required, bestie, no skipping it β but it could be empty, so an empty array ref is valid. slay.content_typeβ aCourriel::Header::ContentTypeobject. Defaults to one with a mime type of"multipart/mixed". if you don't pick, she picks for you πboundaryβ the part boundary. If none is provided, a unique value will be generated. automatic queen behavior β¨preambleβ content that appears before the first part boundary. This will be seen by email clients that don't understand multipart messages. so like, it's for the ones who don't get the assignment π₯²epilogueβ content that appears after the final part boundary. The spec allows for this, but it's probably not very useful. the spec said yes, life saidβ¦ meh πheadersβ aCourriel::Headersobject containing headers for this part.
$part->parts()
Returns an array (not a reference) of the parts this part contains. not a ref!! an actual array!! we love clarity π
$part->part_count()
Returns the number of parts this part contains. counting her children, as one does π
$part->boundary()
Returns the part boundary.
$part->mime_type()
Returns the mime type for this part.
$part->content_type()
Returns the Courriel::Header::ContentType object for this part.
$part->headers()
Returns the Courriel::Headers object for this part.
$part->is_inline(), $part->is_attachment()
These methods always return false, but exist for the sake of providing a consistent API between Single and Multipart part objects. so no, she's never inline, she's never an attachment β she's simply built different and the API stays consistent. periodt. β
$part->is_multipart()
Returns true. obviously. look at her. π
$part->preamble()
The preamble as passed to the constructor.
$part->epilogue()
The epilogue as passed to the constructor.
$part->container()
Returns the Courriel or Courriel::Part::Multipart object to which this part belongs, if any. This is set when the part is added to another object. so she knows her parent β found family arc fr fr π«Ά
$part->stream_to( output => $output )
This method will send the stringified part to the specified output. The output can be a subroutine reference, a filehandle, or an object with a print() method. The output may be sent as a single string, as a list of strings, or via multiple calls to the output. she's flexible like that, no cap π
$part->as_string()
Returns the part as a string, along with its headers. Lines will be terminated with "\r\n". yes, \r\n, exactly that, do not come for her about it π
π§ ROLES π§
This class does the Courriel::Role::Part and Courriel::Role::Streams roles. two roles, both iconic, both hers π
π₯ SUPPORT π₯
Bugs may be submitted at https://github.com/houseabsolute/Courriel/issues.
I am also usually active on IRC as 'autarch' on irc://irc.perl.org. come say hi, he's literally right there π
β SOURCE β
The source code repository for Courriel can be found at https://github.com/houseabsolute/Courriel.
πΈ AUTHOR πΈ
Dave Rolsky <autarch@urth.org>
π COPYRIGHT AND LICENSE π
This software is Copyright (c) 2021 by Dave Rolsky.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
The full text of the license can be found in the LICENSE file included with this distribution.
and that's the whole page bestie, you ate π β¨
sign-off time: this was perl v5.32.1, dated 2021-08-22, from the Courri...ltipart(3pm) page. go forth and nest your parts, you've got this π¦π
π¦ where this page comes from
- debian bookworm: libcourriel-perl 0.49-1 Β· Artistic-2.0
- debian trixie: libcourriel-perl 0.49-1 Β· Artistic-2.0
- ubuntu jammy: libcourriel-perl 0.49-1 Β· Artistic-2.0
- ubuntu noble: libcourriel-perl 0.49-1 Β· Artistic-2.0
- ubuntu resolute: libcourriel-perl 0.49-1 Β· Artistic-2.0
- ubuntu stonking: libcourriel-perl 0.49-1 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms