Mail::Message::Field::Flex - one line of a message header
| Use Case | Command | Description |
|---|---|---|
| Create field from line | Mail::Message::Field::Flex->new('Subject: Hello') | Parse a raw header line |
| Create field with attributes | Mail::Message::Field::Flex->new('Content-Type', 'text/plain', charset => 'utf-8') | Set MIME type with attributes |
| Get body text | $field->body | Return unfolded body |
| Get attributes | $field->attributes | Return hash of attributes |
| Unfold body | $field->unfoldedBody | Remove line folding |
| Clone a field | $field->clone | Deep copy |
| Convert to date | $field->toDate | Parse date field |
| Study structured content | $field->study | Parse complex field |
| Strip comments/whitespace | $field->stripCFWS | Remove CFWS from field |
Mail::Message::Field::Flex is a Mail::Message::Field is a Mail::Reporter
(No content)
This is the flexible implementation of a field: it can easily be extended because it stores its data in a hash and the constructor (new) and initializer (init) are split. However, you pay the price in performance. Mail::Message::Field::Fast is faster (as the name predicts).
Extends "DESCRIPTION" in Mail::Message::Field.
Extends "OVERLOADED" in Mail::Message::Field.
overload: "" โ Inherited, see "OVERLOADED" in Mail::Message::Fieldoverload: 0+ โ Inherited, see "OVERLOADED" in Mail::Message::Fieldoverload: <=> โ Inherited, see "OVERLOADED" in Mail::Message::Fieldoverload: bool โ Inherited, see "OVERLOADED" in Mail::Message::Fieldoverload: cmp โ Inherited, see "OVERLOADED" in Mail::Message::FieldExtends "METHODS" in Mail::Message::Field.
Extends "Constructors" in Mail::Message::Field.
$obj->clone() โ Inherited, see "Constructors" in Mail::Message::FieldMail::Message::Field::Flex->new($data) โ If you stick to this flexible class of header fields, you have a bit more facilities than with Mail::Message::Field::Fast. Amongst it, you can specify options with the creation.
new LINE โ Pass a LINE as it could be found in a file: a (possibly folded) line which is terminated by a new-line.new NAME, (BODY|OBJECTS), [ATTRIBUTES], OPTIONS โ A set of values which shape the line.| -Option | --Defined in | --Default |
attributes | [] | |
comment | undef | |
log | Mail::Reporter | 'WARNINGS' |
trace | Mail::Reporter | 'WARNINGS' |
attributes => ATTRS โ Reference to array with list of key-value pairs representing attributes, or reference to a hash containing these pairs. This is an alternative notation for specifying ATTRIBUTES directly as method arguments.comment => STRING โ A pre-formatted list of attributes.log => LEVELtrace => LEVELExtends "The field" in Mail::Message::Field.
$obj->isStructured() / Mail::Message::Field::Flex->isStructured() โ Inherited, see "The field" in Mail::Message::Field$obj->length() โ Inherited, see "The field" in Mail::Message::Field$obj->nrLines() โ Inherited, see "The field" in Mail::Message::Field$obj->print( [$fh] ) โ Inherited, see "The field" in Mail::Message::Field$obj->size() โ Inherited, see "The field" in Mail::Message::Field$obj->string( [$wrap] ) โ Inherited, see "The field" in Mail::Message::Field$obj->toDisclose() โ Inherited, see "The field" in Mail::Message::FieldExtends "Access to the name" in Mail::Message::Field.
$obj->Name() โ Inherited, see "Access to the name" in Mail::Message::Field$obj->name() โ Inherited, see "Access to the name" in Mail::Message::Field$obj->wellformedName( [STRING] ) โ Inherited, see "Access to the name" in Mail::Message::FieldExtends "Access to the body" in Mail::Message::Field.
$obj->body() โ Inherited, see "Access to the body" in Mail::Message::Field$obj->folded() โ Inherited, see "Access to the body" in Mail::Message::Field$obj->foldedBody( [$body] ) โ Inherited, see "Access to the body" in Mail::Message::Field$obj->stripCFWS( [STRING] ) / Mail::Message::Field::Flex->stripCFWS( [STRING] ) โ Inherited, see "Access to the body" in Mail::Message::Field$obj->unfoldedBody( [$body, [$wrap]] ) โ Inherited, see "Access to the body" in Mail::Message::FieldExtends "Access to the content" in Mail::Message::Field.
$obj->addresses() โ Inherited, see "Access to the content" in Mail::Message::Field$obj->attribute( $name, [$value] ) โ Inherited, see "Access to the content" in Mail::Message::Field$obj->attributes() โ Inherited, see "Access to the content" in Mail::Message::Field$obj->comment( [STRING] ) โ Inherited, see "Access to the content" in Mail::Message::Field$obj->study() โ Inherited, see "Access to the content" in Mail::Message::Field$obj->toDate( [$time] ) / Mail::Message::Field::Flex->toDate( [$time] ) โ Inherited, see "Access to the content" in Mail::Message::Field$obj->toInt() โ Inherited, see "Access to the content" in Mail::Message::FieldExtends "Other methods" in Mail::Message::Field.
$obj->dateToTimestamp(STRING) / Mail::Message::Field::Flex->dateToTimestamp(STRING) โ Inherited, see "Other methods" in Mail::Message::FieldExtends "Internals" in Mail::Message::Field.
$obj->consume( $line | <$name,<$body|$objects>> ) โ Inherited, see "Internals" in Mail::Message::Field$obj->defaultWrapLength( [$length] ) โ Inherited, see "Internals" in Mail::Message::Field$obj->fold( $name, $body, [$maxchars] ) / Mail::Message::Field::Flex->fold( $name, $body, [$maxchars] ) โ Inherited, see "Internals" in Mail::Message::Field$obj->setWrapLength( [$length] ) โ Inherited, see "Internals" in Mail::Message::Field$obj->stringifyData(STRING|ARRAY|$objects) โ Inherited, see "Internals" in Mail::Message::Field$obj->unfold(STRING) โ Inherited, see "Internals" in Mail::Message::FieldExtends "Error handling" in Mail::Message::Field.
$obj->AUTOLOAD() โ Inherited, see "Error handling" in Mail::Reporter$obj->addReport($object) โ Inherited, see "Error handling" in Mail::Reporter$obj->defaultTrace( [$level]|[$loglevel, $tracelevel]|[$level, $callback] ) / Mail::Message::Field::Flex->defaultTrace( [$level]|[$loglevel, $tracelevel]|[$level, $callback] ) โ Inherited, see "Error handling" in Mail::Reporter$obj->errors() โ Inherited, see "Error handling" in Mail::Reporter$obj->log( [$level, [$strings]] ) / Mail::Message::Field::Flex->log( [$level, [$strings]] ) โ Inherited, see "Error handling" in Mail::Reporter$obj->logPriority($level) / Mail::Message::Field::Flex->logPriority($level) โ Inherited, see "Error handling" in Mail::Reporter$obj->logSettings() โ Inherited, see "Error handling" in Mail::Reporter$obj->notImplemented() โ Inherited, see "Error handling" in Mail::Reporter$obj->report( [$level] ) โ Inherited, see "Error handling" in Mail::Reporter$obj->reportAll( [$level] ) โ Inherited, see "Error handling" in Mail::Reporter$obj->trace( [$level] ) โ Inherited, see "Error handling" in Mail::Reporter$obj->warnings() โ Inherited, see "Error handling" in Mail::ReporterExtends "Cleanup" in Mail::Message::Field.
$obj->DESTROY() โ Inherited, see "Cleanup" in Mail::ReporterExtends "DETAILS" in Mail::Message::Field.
โ ๏ธ Warning: Field content is not numerical: $content
The numeric value of a field is requested (for instance the "Lines" or "Content-Length" fields should be numerical), however the data contains weird characters.
โ ๏ธ Warning: Illegal character in field name $name
A new field is being created which does contain characters not permitted by the RFCs. Using this field in messages may break other e-mail clients or transfer agents, and therefore mutulate or extinguish your message.
โ Error: Package $package does not implement $method.
Fatal error: the specific package (or one of its superclasses) does not implement this method where it should. This message means that some other related classes do implement this method however the class at hand does not. Probably you should investigate this and probably inform the author of the package.
This module is part of Mail-Message distribution version 3.012, built on February 11, 2022. Website: http://perl.overmeer.net/CPAN/
Copyrights 2001-2022 by [Mark Overmeer <markov AT cpan.org>]. 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/
Generated by phpman v4.9.29 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-20 17:58 @2600:1f28:365:80b0:8802:8bb4:3873:328e
CrawledBy CCBot/2.0 (https://commoncrawl.org/faq/)
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format