.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.48) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Required to disable full justification in groff 1.23.0. .if n .ds AD l .\" ======================================================================== .\" .IX Title "Mail::Field 3" .TH Mail::Field 3 2026-10-24 "perl v5.44.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh Mail::Field \- base\-class for manipulation of mail header fields .PP .Vb 1 \& use Mail::Field; \& \& my $field = Mail::Field\->new(\*(AqSubject\*(Aq, \*(Aqsome subject text\*(Aq); \& my $field = Mail::Field\->new(Subject => \*(Aqsome subject text\*(Aq); \& print $field\->tag,": ",$field\->stringify,"\en"; \& \& my $field = Mail::Field\->subject(\*(Aqsome subject text\*(Aq); .Ve .PP \&\f(CW\*(C`Mail::Field\*(C'\fR 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. .PP People are invited to merge their implementation to special fields into MailTools, to maintain a consistent set of packages and documentation. .PP =c_method new \f(CW$tag\fR [, STRING | \f(CW%options\fR] Create an object in the class which defines the field specified by the \f(CW$tag\fR argument. .PP It is more clear to call either \fBstringify()\fR or \fBparse()\fR directly, because this method does not add additional processing. .PP All sub\-classes should be called Mail::Field::\fIname\fR where \fIname\fR is derived from the tag using these rules. .IP \(bu 4 Consider a tag as being made up of elements separated by \*(Aq\-\*(Aq .IP \(bu 4 Convert all characters to lowercase except the first in each element, which should be uppercase. .IP \(bu 4 \&\fIname\fR is then created from these elements by using the first N characters from each element. .IP \(bu 4 N is calculated by using the formula :\- .Sp .Vb 1 \& int((7 + #elements) / #elements) .Ve .IP \(bu 4 \&\fIname\fR is then limited to a maximum of 8 characters, keeping the first 8 characters. .PP For an example of this take a look at the definition of the \&\f(CW_header_pkg_name()\fR subroutine in \f(CW\*(C`Mail::Field\*(C'\fR .SH "POD ERRORS" .IX Header "POD ERRORS" Hey! \fBThe above document had some coding errors, which are explained below:\fR .IP "Around line 12:" 4 .IX Item "Around line 12:" Unknown directive: =chapter .IP "Around line 16:" 4 .IX Item "Around line 16:" Unknown directive: =chapter .IP "Around line 26:" 4 .IX Item "Around line 26:" Unknown directive: =chapter .IP "Around line 28:" 4 .IX Item "Around line 28:" Deleting unknown formatting code M<> .IP "Around line 36:" 4 .IX Item "Around line 36:" Unknown directive: =chapter .IP "Around line 136:" 4 .IX Item "Around line 136:" Unknown directive: =section .IP "Around line 144:" 4 .IX Item "Around line 144:" Unknown directive: =error .IP "Around line 162:" 4 .IX Item "Around line 162:" =cut found outside a pod block. Skipping to next block. .IP "Around line 207:" 4 .IX Item "Around line 207:" =cut found outside a pod block. Skipping to next block. .IP "Around line 235:" 4 .IX Item "Around line 235:" Unknown directive: =section .IP "Around line 237:" 4 .IX Item "Around line 237:" Unknown directive: =method .IP "Around line 251:" 4 .IX Item "Around line 251:" Unknown directive: =method .IP "Around line 263:" 4 .IX Item "Around line 263:" Unknown directive: =section .IP "Around line 265:" 4 .IX Item "Around line 265:" Unknown directive: =method .IP "Around line 275:" 4 .IX Item "Around line 275:" =cut found outside a pod block. Skipping to next block. .IP "Around line 288:" 4 .IX Item "Around line 288:" Unknown directive: =method .IP "Around line 298:" 4 .IX Item "Around line 298:" Unknown directive: =section .IP "Around line 300:" 4 .IX Item "Around line 300:" Unknown directive: =method .IP "Around line 304:" 4 .IX Item "Around line 304:" Deleting unknown formatting code M<> .Sp Deleting unknown formatting code M<> .IP "Around line 314:" 4 .IX Item "Around line 314:" Unknown directive: =chapter .IP "Around line 316:" 4 .IX Item "Around line 316:" Unknown directive: =section