Mail::SpamAssassin::Header::ParameterHeader - a header with an
optional main value and subsequent name=value pairs
my $header = Mail::SpamAssassin::Header::ParameterHeader->new('text/plain; charset="utf-8"');
print $header->value; # text/plain
print $header->parameter('charset'); # utf-8
This class is used internally by SpamAssassin to parse headers
that contain a main value followed by name=value pairs.
- new($value,[$opts])
- Creates a new instance of the class. Accepts the raw header value as a
string and an optional hash reference of options.
The following options are available:
- If set to a false value (default), all comments will be removed from the
header value. Otherwise, comments will be preserved.
- value()
- Returns the main value of the header.
- parameters()
- Returns a list of parameter names.
- parameter($name)
- Returns the value(s) of the parameter with the given name. If there are
multiple parameters with the same name, and the method is called in scalar
context, only the first value is returned. If called in list context, all
values are returned.