Mail::...rHeader(3pm)
π NAME π
Mail::SpamAssassin::Header::ParameterHeader β bestie, it's a header that's got a main value and then a little parade of name=value pairs trailing behind it, optional but iconic β¨
π¦ SYNOPSIS π¦
my $header = Mail::SpamAssassin::Header::ParameterHeader->new('text/plain; charset="utf-8"');
print $header->value; # text/plain
print $header->parameter('charset'); # utf-8
Likeβ¦ look at that. She parsed it. She ate. π
πΈ DESCRIPTION πΈ
Okay so here's the tea: this class is used internally by SpamAssassin to parse headers that have a main value followed by name=value pairs. That's literally it, that's her whole job, and she does it flawlessly. No notes. π
π METHODS π
new($value,[$opts])β creates a fresh new instance of the class, main character energy fr fr. She takes the raw header value as a string, plus an optional hash reference of options if you're feeling extra π«Ά
The following options are available:
keep_comments(0|1) β default:0. So if you set this to a false value (which is the default, no cap), all comments get removed from the header value. Set it to true instead and the comments will be preserved. Your call bestie π
value()β returns the main value of the header. The moment. The headliner. βparameters()β returns a list of parameter names. Just the names, all of them, in a cute lil list πparameter($name)β returns the value(s) of the parameter with the given name. And here's the important bit, so listen up: if there are multiple parameters with the same name and you call this in scalar context, you only get the first value back. If you call it in list context, you get all the values. Context matters, iykyk π
Not me writing a whole method just to say "context dependent"β¦ anyway she said what she said π
That's the whole page, bestie, go forth and parse π¦ This lil number is from the User Contributed Perl Documentation, running on perl v5.40.1, dated 2026-07-23, and it lives under the name Mail::...rHeader(3pm) πβ¨π
π¦ where this page comes from
- ubuntu stonking: spamassassin 4.0.2+svn1935691-1build1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms