Mail::SpamAssassin::Header::ParameterHeader(3p)

NAME
Mail::SpamAssassin::Header::ParameterHeader - a header with an optional main value and subsequent name=value pairs

SYNOPSIS
    my $header = Mail::SpamAssassin::Header::ParameterHeader->new('text/plain; charset="utf-8"');
    print $header->value; # text/plain
    print $header->parameter('charset'); # utf-8

DESCRIPTION
This class is used internally by SpamAssassin to parse headers that contain a main value followed by name=value pairs.

METHODS

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:

    keep_comments (0|1) default: 0
        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.