OS Manuals

Mail::Field(3pm)

Mail::Field(3) User Contributed Perl Documentation Mail::Field(3)

Mail::Field - base-class for manipulation of mail header fields

 use Mail::Field;
    
 my $field = Mail::Field->new('Subject', 'some subject text');
 my $field = Mail::Field->new(Subject => 'some subject text');
 print $field->tag,": ",$field->stringify,"\n";
 my $field = Mail::Field->subject('some subject text');

"Mail::Field" creates and manipulates fields in MIME headers, collected within a Mail::Header object. Different field types have their own sub-class (extension), defining additional useful accessors to the field content.

People are invited to merge their implementation to special fields into MailTools, to maintain a consistent set of packages and documentation.

=c_method new $tag [, STRING | %options] Create an object in the class which defines the field specified by the $tag argument.

It is more clear to call either stringify() or parse() directly, because this method does not add additional processing.

All sub-classes should be called Mail::Field::name where name is derived from the tag using these rules.

For an example of this take a look at the definition of the _header_pkg_name() subroutine in "Mail::Field"

Hey! The above document had some coding errors, which are explained below:

Unknown directive: =chapter
Unknown directive: =chapter
Unknown directive: =chapter
Deleting unknown formatting code M<>
Unknown directive: =chapter
Unknown directive: =section
Unknown directive: =error
=cut found outside a pod block. Skipping to next block.
=cut found outside a pod block. Skipping to next block.
Unknown directive: =section
Unknown directive: =method
Unknown directive: =method
Unknown directive: =section
Unknown directive: =method
=cut found outside a pod block. Skipping to next block.
Unknown directive: =method
Unknown directive: =section
Unknown directive: =method
Deleting unknown formatting code M<>

Deleting unknown formatting code M<>

Unknown directive: =chapter
Unknown directive: =section
2026-10-26 perl v5.44.0

perl-mailtools 2.22-r5 · os · ingested 2026-10-27