.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.45) .\" .\" 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::Message::Field::Flex 3" .TH Mail::Message::Field::Flex 3 2026-04-11 "perl v5.42.2" "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 .SH NAME Mail::Message::Field::Flex \- one line of a message header .SH INHERITANCE .IX Header "INHERITANCE" .Vb 3 \& Mail::Message::Field::Flex \& is a Mail::Message::Field \& is a Mail::Reporter .Ve .SH SYNOPSIS .IX Header "SYNOPSIS" .SH DESCRIPTION .IX Header "DESCRIPTION" This is the flexible implementation of a field: it can easily be extended because it stores its data in a hash and the constructor (\f(CW\*(C`new\*(C'\fR) and initializer (\f(CW\*(C`init\*(C'\fR) are split. However, you pay the price in performance. Mail::Message::Field::Fast is faster (as the name predicts). .PP Extends "DESCRIPTION" in Mail::Message::Field. .SH OVERLOADED .IX Header "OVERLOADED" Extends "OVERLOADED" in Mail::Message::Field. .IP "overload: \fB\*(Aq""""\*(Aq\fR stringification" 4 .IX Item "overload: '""""' stringification" Inherited, see "OVERLOADED" in Mail::Message::Field .IP "overload: \fB\*(Aq0+\*(Aq\fR numification" 4 .IX Item "overload: '0+' numification" Inherited, see "OVERLOADED" in Mail::Message::Field .IP "overload: \fB\*(Aq<=\fR\*(Aq> numeric comparison" 4 .IX Item "overload: '<='> numeric comparison" Inherited, see "OVERLOADED" in Mail::Message::Field .IP "overload: \fBbool\fR boolean" 4 .IX Item "overload: bool boolean" Inherited, see "OVERLOADED" in Mail::Message::Field .IP "overload: \fBcmp\fR string comparison" 4 .IX Item "overload: cmp string comparison" Inherited, see "OVERLOADED" in Mail::Message::Field .SH METHODS .IX Header "METHODS" Extends "METHODS" in Mail::Message::Field. .SS Constructors .IX Subsection "Constructors" Extends "Constructors" in Mail::Message::Field. .ie n .IP $obj\->\fBclone\fR() 4 .el .IP \f(CW$obj\fR\->\fBclone\fR() 4 .IX Item "$obj->clone()" Inherited, see "Constructors" in Mail::Message::Field .ie n .IP "$class\->\fBnew\fR($line | ($name, ($body|$object|\e@objects), [@attributes], [\e%options|\e@options]))" 4 .el .IP "\f(CW$class\fR\->\fBnew\fR($line | ($name, ($body|$object|\e@objects), [@attributes], [\e%options|\e@options]))" 4 .IX Item "$class->new($line | ($name, ($body|$object|@objects), [@attributes], [%options|@options]))" 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. Possible arguments: .RS 4 .IP \(bu 4 \&\fBnew\fR \f(CW$line\fR .Sp Pass a \f(CW$line\fR as it could be found in a file: a (possibly folded) line which is terminated by a new\-line. .IP \(bu 4 \&\fBnew\fR \f(CW$name\fR, (\f(CW$body\fR|\f(CW$object\fR|\e\f(CW@objects\fR), [\f(CW@attributes\fR], [\e\f(CW%options\fR|\e\f(CW@options\fR] .Sp A set of values which shape the line. .RE .RS 4 .Sp To be able to distinguish the different parameters, you will have to specify the \f(CW@options\fR as ARRAY of option PAIRS, or HASH of \f(CW%options\fR. The \f(CW@attributes\fR are a flat LIST of key\-value PAIRS. The \f(CW$body\fR is specified as one string, one \f(CW$object\fR, or an ARRAY of \f(CW@objects\fR. See Mail::Message::Field. Improves base, see "Constructors" in Mail::Message::Field .Sp .Vb 3 \& \-Option \-\-Default \& attributes +[ ] \& comment undef .Ve .IP "attributes => \e@attributes|\e%attributes" 2 .IX Item "attributes => @attributes|%attributes" An ARRAY with contains of key\-value pairs representing \f(CW@attributes\fR, or reference to a HASH containing these pairs. This is an alternative notation for specifying \f(CW@attributes\fR directly as method arguments. .ie n .IP "comment => $text" 2 .el .IP "comment => \f(CW$text\fR" 2 .IX Item "comment => $text" A pre\-formatted list of attributes. .RE .RS 4 .RE .SS Attributes .IX Subsection "Attributes" Extends "Attributes" in Mail::Message::Field. .ie n .IP $obj\->\fBName\fR() 4 .el .IP \f(CW$obj\fR\->\fBName\fR() 4 .IX Item "$obj->Name()" Inherited, see "Attributes" in Mail::Message::Field .ie n .IP $obj\->\fBbody\fR() 4 .el .IP \f(CW$obj\fR\->\fBbody\fR() 4 .IX Item "$obj->body()" Inherited, see "Attributes" in Mail::Message::Field .ie n .IP $obj\->\fBfolded\fR() 4 .el .IP \f(CW$obj\fR\->\fBfolded\fR() 4 .IX Item "$obj->folded()" Inherited, see "Attributes" in Mail::Message::Field .ie n .IP "$obj\->\fBfoldedBody\fR( [$body] )" 4 .el .IP "\f(CW$obj\fR\->\fBfoldedBody\fR( [$body] )" 4 .IX Item "$obj->foldedBody( [$body] )" Inherited, see "Attributes" in Mail::Message::Field .ie n .IP $obj\->\fBname\fR() 4 .el .IP \f(CW$obj\fR\->\fBname\fR() 4 .IX Item "$obj->name()" Inherited, see "Attributes" in Mail::Message::Field .ie n .IP "$obj\->\fBunfoldedBody\fR( [$body, [$wrap]] )" 4 .el .IP "\f(CW$obj\fR\->\fBunfoldedBody\fR( [$body, [$wrap]] )" 4 .IX Item "$obj->unfoldedBody( [$body, [$wrap]] )" Inherited, see "Attributes" in Mail::Message::Field .ie n .IP "$obj\->\fBwellformedName\fR( [STRING] )" 4 .el .IP "\f(CW$obj\fR\->\fBwellformedName\fR( [STRING] )" 4 .IX Item "$obj->wellformedName( [STRING] )" Inherited, see "Attributes" in Mail::Message::Field .SS "The field" .IX Subsection "The field" Extends "The field" in Mail::Message::Field. .ie n .IP "$any\->\fBisStructured\fR( [$name] )" 4 .el .IP "\f(CW$any\fR\->\fBisStructured\fR( [$name] )" 4 .IX Item "$any->isStructured( [$name] )" Inherited, see "The field" in Mail::Message::Field .ie n .IP $obj\->\fBlength\fR() 4 .el .IP \f(CW$obj\fR\->\fBlength\fR() 4 .IX Item "$obj->length()" Inherited, see "The field" in Mail::Message::Field .ie n .IP $obj\->\fBnrLines\fR() 4 .el .IP \f(CW$obj\fR\->\fBnrLines\fR() 4 .IX Item "$obj->nrLines()" Inherited, see "The field" in Mail::Message::Field .ie n .IP "$obj\->\fBprint\fR( [$fh] )" 4 .el .IP "\f(CW$obj\fR\->\fBprint\fR( [$fh] )" 4 .IX Item "$obj->print( [$fh] )" Inherited, see "The field" in Mail::Message::Field .ie n .IP $obj\->\fBsize\fR() 4 .el .IP \f(CW$obj\fR\->\fBsize\fR() 4 .IX Item "$obj->size()" Inherited, see "The field" in Mail::Message::Field .ie n .IP "$obj\->\fBstring\fR( [$wrap] )" 4 .el .IP "\f(CW$obj\fR\->\fBstring\fR( [$wrap] )" 4 .IX Item "$obj->string( [$wrap] )" Inherited, see "The field" in Mail::Message::Field .ie n .IP $obj\->\fBtoDisclose\fR() 4 .el .IP \f(CW$obj\fR\->\fBtoDisclose\fR() 4 .IX Item "$obj->toDisclose()" Inherited, see "The field" in Mail::Message::Field .SS "Access to the content" .IX Subsection "Access to the content" Extends "Access to the content" in Mail::Message::Field. .ie n .IP $obj\->\fBaddresses\fR() 4 .el .IP \f(CW$obj\fR\->\fBaddresses\fR() 4 .IX Item "$obj->addresses()" Inherited, see "Access to the content" in Mail::Message::Field .ie n .IP "$obj\->\fBattribute\fR( $name, [$value] )" 4 .el .IP "\f(CW$obj\fR\->\fBattribute\fR( \f(CW$name\fR, [$value] )" 4 .IX Item "$obj->attribute( $name, [$value] )" Inherited, see "Access to the content" in Mail::Message::Field .ie n .IP $obj\->\fBattributes\fR() 4 .el .IP \f(CW$obj\fR\->\fBattributes\fR() 4 .IX Item "$obj->attributes()" Inherited, see "Access to the content" in Mail::Message::Field .ie n .IP "$obj\->\fBcomment\fR( [STRING] )" 4 .el .IP "\f(CW$obj\fR\->\fBcomment\fR( [STRING] )" 4 .IX Item "$obj->comment( [STRING] )" Inherited, see "Access to the content" in Mail::Message::Field .ie n .IP $any\->\fBdateToTimestamp\fR(STRING) 4 .el .IP \f(CW$any\fR\->\fBdateToTimestamp\fR(STRING) 4 .IX Item "$any->dateToTimestamp(STRING)" Inherited, see "Access to the content" in Mail::Message::Field .ie n .IP "$any\->\fBstripCFWS\fR( [STRING] )" 4 .el .IP "\f(CW$any\fR\->\fBstripCFWS\fR( [STRING] )" 4 .IX Item "$any->stripCFWS( [STRING] )" Inherited, see "Access to the content" in Mail::Message::Field .ie n .IP $obj\->\fBstudy\fR() 4 .el .IP \f(CW$obj\fR\->\fBstudy\fR() 4 .IX Item "$obj->study()" Inherited, see "Access to the content" in Mail::Message::Field .ie n .IP "$any\->\fBtoDate\fR( [$time] )" 4 .el .IP "\f(CW$any\fR\->\fBtoDate\fR( [$time] )" 4 .IX Item "$any->toDate( [$time] )" Inherited, see "Access to the content" in Mail::Message::Field .ie n .IP $obj\->\fBtoInt\fR() 4 .el .IP \f(CW$obj\fR\->\fBtoInt\fR() 4 .IX Item "$obj->toInt()" Inherited, see "Access to the content" in Mail::Message::Field .SS Parsing .IX Subsection "Parsing" Extends "Parsing" in Mail::Message::Field. .ie n .IP "$obj\->\fBconsume\fR( $line | <$name,<$body|$objects>> )" 4 .el .IP "\f(CW$obj\fR\->\fBconsume\fR( \f(CW$line\fR | <$name,<$body|$objects>> )" 4 .IX Item "$obj->consume( $line | <$name,<$body|$objects>> )" Inherited, see "Parsing" in Mail::Message::Field .ie n .IP "$obj\->\fBdefaultWrapLength\fR( [$length] )" 4 .el .IP "\f(CW$obj\fR\->\fBdefaultWrapLength\fR( [$length] )" 4 .IX Item "$obj->defaultWrapLength( [$length] )" Inherited, see "Parsing" in Mail::Message::Field .ie n .IP "$any\->\fBfold\fR( $name, $body, [$maxchars] )" 4 .el .IP "\f(CW$any\fR\->\fBfold\fR( \f(CW$name\fR, \f(CW$body\fR, [$maxchars] )" 4 .IX Item "$any->fold( $name, $body, [$maxchars] )" Inherited, see "Parsing" in Mail::Message::Field .ie n .IP "$obj\->\fBsetWrapLength\fR( [$length] )" 4 .el .IP "\f(CW$obj\fR\->\fBsetWrapLength\fR( [$length] )" 4 .IX Item "$obj->setWrapLength( [$length] )" Inherited, see "Parsing" in Mail::Message::Field .ie n .IP $obj\->\fBstringifyData\fR(STRING|ARRAY|$objects) 4 .el .IP \f(CW$obj\fR\->\fBstringifyData\fR(STRING|ARRAY|$objects) 4 .IX Item "$obj->stringifyData(STRING|ARRAY|$objects)" Inherited, see "Parsing" in Mail::Message::Field .ie n .IP $obj\->\fBunfold\fR(STRING) 4 .el .IP \f(CW$obj\fR\->\fBunfold\fR(STRING) 4 .IX Item "$obj->unfold(STRING)" Inherited, see "Parsing" in Mail::Message::Field .SS "Error handling" .IX Subsection "Error handling" Extends "Error handling" in Mail::Message::Field. .ie n .IP $obj\->\fBAUTOLOAD\fR() 4 .el .IP \f(CW$obj\fR\->\fBAUTOLOAD\fR() 4 .IX Item "$obj->AUTOLOAD()" Inherited, see "Error handling" in Mail::Reporter .ie n .IP $obj\->\fBnotImplemented\fR() 4 .el .IP \f(CW$obj\fR\->\fBnotImplemented\fR() 4 .IX Item "$obj->notImplemented()" Inherited, see "Error handling" in Mail::Reporter .SS Cleanup .IX Subsection "Cleanup" Extends "Cleanup" in Mail::Message::Field. .ie n .IP $obj\->\fBDESTROY\fR() 4 .el .IP \f(CW$obj\fR\->\fBDESTROY\fR() 4 .IX Item "$obj->DESTROY()" Inherited, see "Cleanup" in Mail::Reporter .SH DETAILS .IX Header "DETAILS" Extends "DETAILS" in Mail::Message::Field. .SH DIAGNOSTICS .IX Header "DIAGNOSTICS" .ie n .IP "Error: class $package does not implement method $method." 4 .el .IP "Error: class \f(CW$package\fR does not implement method \f(CW$method\fR." 4 .IX Item "Error: class $package does not implement method $method." Fatal error: the specific \f(CW$package\fR (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. Cast by \f(CWnotImplemented()\fR .ie n .IP "Warning: field content is not numerical: $content" 4 .el .IP "Warning: field content is not numerical: \f(CW$content\fR" 4 .IX Item "Warning: field content is not numerical: $content" The numeric value of a field is requested (for instance the \f(CW\*(C`Lines\*(C'\fR or \&\f(CW\*(C`Content\-Length\*(C'\fR fields should be numerical), however the data contains weird characters. Cast by \f(CWtoInt()\fR .ie n .IP "Error: field name too long (max $count), in \*(Aq$name\*(Aq." 4 .el .IP "Error: field name too long (max \f(CW$count\fR), in \*(Aq$name\*(Aq." 4 .IX Item "Error: field name too long (max $count), in '$name'." It is not specified in the RFCs how long a field name can be, but at least it should be a few characters shorter than the line wrap. Cast by \f(CWfold()\fR .ie n .IP "Warning: illegal character in field name $name." 4 .el .IP "Warning: illegal character in field name \f(CW$name\fR." 4 .IX Item "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. Cast by \f(CWconsume()\fR .SH "SEE ALSO" .IX Header "SEE ALSO" This module is part of Mail\-Message version 4.05, built on April 10, 2026. Website: \fIhttp://perl.overmeer.net/mailbox/\fR .SH LICENSE .IX Header "LICENSE" For contributors see file ChangeLog. .PP This software is copyright (c) 2001\-2026 by Mark Overmeer. .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.