perldoc > Mail::Message::Field::Fast

๐Ÿ“› NAME

Mail::Message::Field::Fast โ€” one line of a message header

๐Ÿš€ Quick Reference

Use CaseCommandDescription
๐Ÿ“„ Create from raw lineMail::Message::Field::Fast->new($line)Parse a header line from a file
๐Ÿงฉ Create from name & bodyMail::Message::Field::Fast->new($name, $body)Build field from separate parts
๐Ÿท๏ธ Get field name$field->name()Retrieve the field name (e.g. "Subject")
๐Ÿ“ Get field body$field->body()Retrieve the field body content
๐Ÿ”ค Get string representation$field->string()Full field as "Name: body"
๐Ÿ–จ๏ธ Print field$field->print($fh)Write field to filehandle
๐Ÿ“ Get field length$field->length()Length of the field string
๐Ÿ“Š Get field size$field->size()Size of the field in bytes
๐Ÿ“ฌ Get addresses$field->addresses()Parse To/Cc/Bcc into Mail::Address objects
๐Ÿ”‘ Get attribute$field->attribute($name)Get a specific MIME attribute
๐Ÿ“‹ Get all attributes$field->attributes()Get all MIME attributes as object
๐Ÿ“… Parse as date$field->toDate()Parse Date field into time value
๐Ÿ”ข Parse as integer$field->toInt()Parse numeric field (e.g. Lines)

๐Ÿงฌ INHERITANCE

Mail::Message::Field::Fast
โ†ณ is a Mail::Message::Field
โ†ณ is a Mail::Reporter

๐Ÿ“‹ SYNOPSIS

See Mail::Message::Field

๐Ÿ“– DESCRIPTION

This is the faster, but less flexible implementation of a header field. The data is stored in an array, and some hacks are made to speeds things up. Be gentle with me, and consider that each message contains many of these lines, so speed is very important here.

Extends "DESCRIPTION" in Mail::Message::Field.

๐Ÿ”„ OVERLOADED

Extends "OVERLOADED" in Mail::Message::Field.

๐Ÿ”„ overload: ""

Inherited, see "OVERLOADED" in Mail::Message::Field

๐Ÿ”„ overload: 0+

Inherited, see "OVERLOADED" in Mail::Message::Field

๐Ÿ”„ overload: <=>

Inherited, see "OVERLOADED" in Mail::Message::Field

๐Ÿ”„ overload: bool

Inherited, see "OVERLOADED" in Mail::Message::Field

๐Ÿ”„ overload: cmp

Inherited, see "OVERLOADED" in Mail::Message::Field

โš™๏ธ METHODS

Extends "METHODS" in Mail::Message::Field.

๐Ÿ—๏ธ Constructors

Extends "Constructors" in Mail::Message::Field.

Mail::Message::Field::Fast->new($data)

The constructor of this object does not follow the usual practise within the Mail::Box suite: it does not use the constructor Mail::Reporter::new(). Therefor it has no logging or tracing facilities.

The method can be used in one of the following ways:

Create a new header field object. Specify the whole LINE at once, and it will be split-up for you. I case you already have the parts of the header line, you may specify them separately as NAME and BODY.

In case you specify a single OBJECT, or a reference to an array of OBJECTS, these objects are processed to become suitable to fill a field, usually by simple strification. When you specify one or more Mail::Address objects, these are transformed into a string using their "format" method. You may also add one Mail::Message::Field, whose body is taken. In case of an array, the elements are joined into one string with a comma.

ATTRIBUTES can be exactly one string which may contain multiple attributes at once, quoted and formatted as required in RFC2822. As alternative, list of key-value pairs can be used. In this case, the values will get quoted if needed and everything formatted as the protocol demands.

OptionDefined inDefault
logMail::Reporter<disabled>
traceMail::Reporter<disabled>

log => LEVEL
trace => LEVEL

Examples:

my $mime = Mail::Message::Field->new(
    'Content-Type: text/plain; charset=US-ASCII');

my $mime = Mail::Message::Field->new(
    'Content-Type' => 'text/plain; charset=US-ASCII');

my $mime = Mail::Message::Field->new(
    'Content-Type' => 'text/plain', 'charset=US-ASCII');

my $mime = Mail::Message::Field->new(
    'Content-Type' => 'text/plain', charset => 'Latin1');

my $mime = Mail::Message::Field->new(
    To => Mail::Address->new('My', 'me AT example.com');

my $mime = Mail::Message::Field->new(
    Cc => [ Mail::Address->new('You', 'you AT example.com')
          , Mail::Address->new('His', 'he AT example.com')
          ]);

But in practice, you can simply call

my $head = Mail::Message::Head->new;
$head->add( 'Content-Type' => 'text/plain'
           , charset => 'utf8');

which implicitly calls this constructor (when needed). You can specify the same things for Mail::Message::Head::Complete::add() as this "new" accepts.

๐Ÿ“„ The field

Extends "The field" in Mail::Message::Field.

๐Ÿท๏ธ Access to the name

Extends "Access to the name" in Mail::Message::Field.

๐Ÿ“ Access to the body

Extends "Access to the body" in Mail::Message::Field.

๐Ÿ“ฆ Access to the content

Extends "Access to the content" in Mail::Message::Field.

๐Ÿ”ง Other methods

Extends "Other methods" in Mail::Message::Field.

๐Ÿ”ฌ Internals

Extends "Internals" in Mail::Message::Field.

โš ๏ธ Error handling

Extends "Error handling" in Mail::Message::Field.

๐Ÿงน Cleanup

Extends "Cleanup" in Mail::Message::Field.

๐Ÿ” DETAILS

Extends "DETAILS" in Mail::Message::Field.

๐Ÿฉบ DIAGNOSTICS

๐Ÿ‘€ SEE ALSO

This module is part of Mail-Message distribution version 3.012, built on February 11, 2022. Website: http://perl.overmeer.net/CPAN/

๐Ÿ“œ LICENSE

Copyrights 2001-2022 by Mark Overmeer. For other contributors see ChangeLog.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://dev.perl.org/licenses/

Mail::Message::Field::Fast
๐Ÿ“› NAME ๐Ÿš€ Quick Reference ๐Ÿงฌ INHERITANCE ๐Ÿ“‹ SYNOPSIS ๐Ÿ“– DESCRIPTION ๐Ÿ”„ OVERLOADED
๐Ÿ”„ overload: "" ๐Ÿ”„ overload: 0+ ๐Ÿ”„ overload: <=> ๐Ÿ”„ overload: bool ๐Ÿ”„ overload: cmp
โš™๏ธ METHODS
๐Ÿ—๏ธ Constructors ๐Ÿ“„ The field ๐Ÿท๏ธ Access to the name ๐Ÿ“ Access to the body ๐Ÿ“ฆ Access to the content ๐Ÿ”ง Other methods ๐Ÿ”ฌ Internals โš ๏ธ Error handling ๐Ÿงน Cleanup
๐Ÿ” DETAILS ๐Ÿฉบ DIAGNOSTICS ๐Ÿ‘€ SEE ALSO ๐Ÿ“œ LICENSE

Generated by phpman v4.9.26-1-g511901d · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-27 09:24 @216.73.216.194
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format

^_top_^