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