| 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.
- Consider a tag as being made up of elements separated by '-'
- Convert all characters to lowercase except the first in each element, which should be uppercase.
- name is then created from these elements by using the first N characters from each element.
- N is calculated by using the formula :-
int((7 + #elements) / #elements) - name is then limited to a maximum of 8 characters, keeping the first 8 characters.
For an example of this take a look at the definition of the _header_pkg_name() subroutine in "Mail::Field"
POD ERRORS
Hey! The above document had some coding errors, which are explained below:
- Around line 12:
- Unknown directive: =chapter
- Around line 16:
- Unknown directive: =chapter
- Around line 26:
- Unknown directive: =chapter
- Around line 28:
- Deleting unknown formatting code M<>
- Around line 36:
- Unknown directive: =chapter
- Around line 136:
- Unknown directive: =section
- Around line 144:
- Unknown directive: =error
- Around line 162:
- =cut found outside a pod block. Skipping to next block.
- Around line 207:
- =cut found outside a pod block. Skipping to next block.
- Around line 235:
- Unknown directive: =section
- Around line 237:
- Unknown directive: =method
- Around line 251:
- Unknown directive: =method
- Around line 263:
- Unknown directive: =section
- Around line 265:
- Unknown directive: =method
- Around line 275:
- =cut found outside a pod block. Skipping to next block.
- Around line 288:
- Unknown directive: =method
- Around line 298:
- Unknown directive: =section
- Around line 300:
- Unknown directive: =method
- Around line 304:
- Deleting unknown formatting code M<>
Deleting unknown formatting code M<>
- Around line 314:
- Unknown directive: =chapter
- Around line 316:
- Unknown directive: =section
| 2026-10-24 | perl v5.44.0 |