NAME
Mail::DKIM2::TagValueList - The tag=value list a DKIM2 header is made of
SYNOPSIS
use Mail::DKIM2::TagValueList;
my $tvl = Mail::DKIM2::TagValueList->parse("i=1; d=example.com");
say $tvl->get_tag('d'); # "example.com"
$tvl->set_tag('t', time);
say $tvl->as_string; # "i=1; d=example.com; t=1740000000"
DESCRIPTION
A semicolon-separated list of tag=value pairs (spec-06 section 2.12 and 8). Tag names keep their original case and order so a parsed header can be re-serialised byte for byte for the signing input; lookups are case-insensitive. Mail::DKIM2::Signature is a subclass.
CONSTRUCTORS
new()
An empty list.
parse($string)
Parses a list, trimming whitespace around names and values.
METHODS
get_tag($name)
The value of the tag, matched case-insensitively, or undef.
set_tag($name, $value)
Sets a tag, appending it to the order if new.
duplicate_tag()
The lowercased name of a tag that appeared more than once in the parsed input, or undef. Section 8 allows one of each; the Verifier reports a repeat as a permerror.
as_string()
The list serialised in its original order, "; " between pairs.
AUTHOR
Bron Gondwana <brong@fastmailteam.com>
COPYRIGHT AND LICENSE
Copyright (c) 2025-2026 Fastmail Pty Ltd. This is free software; you can redistribute it and/or modify it under the same terms as Perl itself.