Courriel::Header(3pm)
π Courriel::Header β a single header's name and value π
okay bestie, welcome to Courriel::Header from the Courriel family (that's Courriel::Header(3pm) if you're being formal, which we are not). This is version 0.49, she's a little icon, let's go π
β¨ VERSION β¨
version 0.49 β yes ma'am, that's the one π
πΈ SYNOPSIS πΈ
my $subject = $headers->get('subject');
print $subject->value;
literally that's it. grab a header, print its value, slay. π¦
π DESCRIPTION π
So this class represents one single header, okay? Just the one. And a header is made of exactly two things: a name and a value. That's the whole personality. name + value = the entire vibe. π«Ά
π API π
This class supports the following methods, and we're going through every single one because I love you:
Courriel::Header->new( ... )
Constructor time!! β¨ This method requires two attributes: name and value. Both of them have to be strings, no cap.
The name cannot be empty β like, it must have something in it, bestie, do not come in here with an empty name.
But the value? The value can be empty. She's allowed to be a little empty. It's fine. We don't judge. π
$header->name()
Returns the header name β literally the exact thing you passed to the constructor. Nothing more, nothing less. iconic behavior.
$header->value()
Returns the header value β again, exactly as passed to the constructor. periodt. π
$header->as_string( charset => $charset )
This one returns the header name and value, with any necessary MIME encoding and folding done for you. Fancy! π
The charset parameter tells it what character set to use for MIME-encoding non-ASCII values. It defaults to utf8. And heads up: the charset name has to be one that the Encode module recognizes, or it's not gonna work, bestie. β
$header->stream_to( output => $output, charset => ... )
She streams π« β this method sends the stringified header to the specified output.
That output can be:
- a subroutine reference,
- a filehandle,
- or an object with a
print()method.
And here's the fun part: the output may be sent as a single string, as a list of strings, or via multiple calls to the output. Any of those! Whatever she feels like! π¦
For the deets on the charset parameter, go read the as_string() method documentation above. iykyk π
π§ ROLES π§
This class does the Courriel::Role::Streams role. That's where the streaming energy comes from, and we love that for her. π
π«Ά SUPPORT π«Ά
Found a bug? First of all, same. Second of all, bugs may be submitted at <https://github.com/houseabsolute/Courriel/issues>.
Also!! I am usually active on IRC as 'autarch' on irc://irc.perl.org. come say hi πΈ
π SOURCE π
The source code repository for Courriel lives at <https://github.com/houseabsolute/Courriel>. go look at the code, it's giving open source excellence. β¨
π AUTHOR π
Dave Rolsky <autarch@urth.org> β the main character, the legend, the one who wrote this. π
π 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. read it, it's important, no skimming. π
π lowkey reminder thatnamecannot be empty butvaluecan β do not get it twisted bestie, that's the whole rule.
and that's the page!! this was Courriel::Header, documented under perl v5.32.1, dated 2021-08-22, and honestly? she ate. mwah π
πβ¨π¦πΈ
π¦ 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