---
name: "Mail::AuthenticationResults::Header::Base"
section: "3pm"
platform: "linux"
package: "perl-mail-authenticationresults"
version: "2.20260216-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/Mail::AuthenticationResults::Header::Base"
---

# Mail::AuthenticationResults::Header::Base(3pm)

Base class for modelling parts of the Authentication Results Header

## NAME

Mail::AuthenticationResults::Header::Base - Base class for modelling parts of the Authentication Results Header

## VERSION

version 2.20260216

## DESCRIPTION

Set of classes representing the various parts and sub parts of Authentication Results Headers.

- •

  Mail::AuthenticationResults::Header represents a complete Authentication Results Header set

- •

  Mail::AuthenticationResults::Header::AuthServID represents the AuthServID part of the set

- •

  Mail::AuthenticationResults::Header::Comment represents a comment

- •

  Mail::AuthenticationResults::Header::Entry represents a main entry

- •

  Mail::AuthenticationResults::Header::Group represents a group of parts, typically as a search result

- •

  Mail::AuthenticationResults::Header::SubEntry represents a sub entry part

- •

  Mail::AuthenticationResults::Header::Version represents a version part

```
    Header
        AuthServID
            Version
            Comment
            SubEntry
        Entry
            Comment
        Entry
            Comment
            SubEntry
                Comment
        Entry
            SubEntry
            SubEntry
    Group
        Entry
            Comment
        SubEntry
            Comment
        Entry
            SubEntry
```

## METHODS

### new()

Return a new instance of this class

### set\_key( $key )

Set the key for this instance.

Croaks if `$key` is invalid.

### key()

Return the current key for this instance.

Croaks if this instance type can not have a key.

### safe\_set\_value( $value )

Set the value for this instance.

Munges the value to remove invalid characters before setting.

This method also removes some value characters when their inclusion would be likely to break simple parsers.

### set\_value( $value )

Set the value for this instance.

Croaks if the value contains invalid characters.

### value()

Returns the current value for this instance.

### stringify( $value )

Returns `$value` with stringify rules applied.

### children()

Returns a listref of this instances children.

Croaks if this instance type can not have children.

### orphan()

Removes the parent for this instance.

Croaks if this instance does not have a parent.

### copy\_children\_from( $object )

Copy (clone) all of the children from the given object into this object.

### add\_parent( $parent )

Sets the parent for this instance to the supplied object.

Croaks if the relationship between `$parent` and `$self` is not valid.

### parent()

Returns the parent object for this instance.

### remove\_child( $child )

Removes `$child` as a child of this instance.

Croaks if the relationship between `$child` and `$self` is not valid.

### add\_child( $child )

Adds `$child` as a child of this instance.

Croaks if the relationship between `$child` and `$self` is not valid.

### add\_entry ($key, $value)

Creates a new entry with the given key and value, and then adds that as a child.

Returns the child added.

### add\_sub\_entry ($self, $key, $value)

Creates a new sub entry with the given key and value, and then adds that as a child.

Returns the child added.

### add\_comment ($key, $value)

Creates a new comment with the given key and value, and then adds that as a child.

Returns the child added.

### ancestor()

Returns the top Header object and depth of this child

### strict\_quotes()

Return the current value of strict quotes flag for this header or for its ancestor if not set locally

If true, we are stricter about which characters result in a quoted string

### set\_strict\_quotes( $value )

Set the value of strict quotes

If true, we are stricter about which characters result in a quoted string

Default false

### as\_string\_prefix( $header )

Add the prefix to as\_string for this object when calledas a child of another objects as\_string method call.

### as\_json()

Return this instance as a JSON serialised string

### as\_string()

Returns this instance as a string.

### build\_string( $header )

Build a string using the supplied Mail::AuthenticationResults::FoldableHeader object.

### search( $search )

Apply search rules in `$search` to this instance and return a Mail::AuthenticationResults::Header::Group object containing the matches.

`$search` is a HASHREF with the following possible key/value pairs

- key

  Match if the instance key matches the supplied value (string or regex)

- value

  Match if the instance value matches the supplied value (string or regex)

- isa

  Match is the instance class typs matches the supplied value. This is a lowercase version of the class type, (comment,entry,subentry,etc))

- has

  An arrayref of searches, match this class if the supplied search queries would return at least 1 result each

## AUTHOR

Marc Bradshaw \<marc@marcbradshaw.net\>

## COPYRIGHT AND LICENSE

This software is copyright (c) 2021 by Marc Bradshaw.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
