Courri...tribute(3pm)
π NAME
okay so this is Courriel::HeaderAttribute β literally one single attribute that belongs to a header. that's the whole vibe. one attribute. one icon. π
(also bestie, the actual page title got truncated to Courri...tribute(3pm) and it lives in the User Contributed Perl Documentation section, which is giving "we ran out of space for your name at the party" energy π)
β¨ VERSION
version 0.49 πΈ
π SYNOPSIS
my $ct = $headers->get('Content-Type');
print $ct->get_attribute('charset')->value;
see how easy that was?? get the header, grab the attribute, print the value. main character behavior fr fr π
π¦ DESCRIPTION
so this class represents a single attribute belonging to a header. one attribute = a name + a value, plus optional charset and language info. that's it, that's the whole personality. π
π API
this class supports the following methods, bestie. buckle up:
π Courriel::HeaderAttribute->new( ... )
this method creates a new object. it accepts the following parameters:
nameβ the name of the attribute. this should be a non-empty string (so like, don't leave it blank, that's not the move π).valueβ the value of the attribute. this one can be empty. she's allowed to be mysterious.charsetβ the charset for the value. if the value contains any non-ASCII data, this will always be"UTF-8", otherwise the default is"us-ascii". no cap, that's just how it is.languageβ the language for the attribute's value. it should be a valid ISO language code like"en-us"or"zh". this is optional. π
π₯ $attribute->name()
the attribute name as passed to the constructor. same one. no glow-up, no transformation. π
π₯ $attribute->value()
the attribute value as passed to the constructor. also unchanged. iconic of her honestly.
π₯ $attribute->charset()
the attribute's charset. β¨
π₯ $attribute->language()
the attribute's language. π
π₯ $attribute->as_string()
this returns the attribute in a form suitable for putting in an email. and bestie, "suitable" is doing a LOT of heavy lifting here β this may involve escaping, quoting, splitting up, and otherwise messing with the value. she's been through things. π
if the value needs to be split across continuations, each name/value pair is returned separate by a space, but not folded across multiple lines. so like, spaced out but not folded. periodt.
π₯ $attribute->stream_to( output => $output )
this method will send the stringified attribute to the specified output. the output can be a subroutine reference, a filehandle, or an object with a print() method. π
and 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. versatile queen. π«Ά
π ROLES
this class does the Courriel::Role::Streams role. she's got range, she's got roles, she's booked and busy. π
π SUPPORT
bugs may be submitted at <https://github.com/houseabsolute/Courriel/issues>. pls be nice and give details bestie π
I am also usually active on IRC as 'autarch' on irc://irc.perl.org. come say hi!! π
π¦ SOURCE
the source code repository for Courriel can be found at <https://github.com/houseabsolute/Courriel>. go look, it's right there. β
π AUTHOR
Dave Rolsky <autarch@urth.org>
(the author himself, the legend, the moment π)
βοΈ 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. go read it, it's giving legally binding but make it cute π
and that's the whole page bestie!! no cap, you now know everything about Courriel::HeaderAttribute. slay. πβ¨
this lil doc drop is from perl v5.32.1, dated 2021-08-22, and yeah she's still rocking that Courri...tribute(3pm) name. k bye!! ππ¦πΈ
π¦ 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