Scroll to navigation

Mail::SpamAssassin::Header::ParameterHeader(3pm) User Contributed Perl Documentation Mail::SpamAssassin::Header::ParameterHeader(3pm)

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

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.
Returns the main value of the header.
Returns a list of parameter names.
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.
2025-02-03 perl v5.40.0