{
    "content": [
        {
            "type": "text",
            "text": "# Mail::Message::Field::Full (perldoc)\n\n## NAME\n\nMail::Message::Field::Full - construct one smart line in a message header\n\n## SYNOPSIS\n\n# Getting to understand the complexity of a header field ...\nmy $fast = $msg->head->get('subject');\nmy $full = Mail::Message::Field::Full->from($fast);\nmy $full = $msg->head->get('subject')->study;  # same\nmy $full = $msg->head->study('subject');       # same\nmy $full = $msg->study('subject');             # same\n# ... or build a complex header field yourself\nmy $f = Mail::Message::Field::Full->new('To');\nmy $f = Mail::Message::Field::Full->new('Subject: hi!');\nmy $f = Mail::Message::Field::Full->new(Subject => 'hi!');\n\n## DESCRIPTION\n\nThis is the *full* implementation of a header field: it has *full* understanding of all\npredefined header fields. These objects will be quite slow, because header fields can be very\ncomplex. Of course, this class delivers the optimal result, but for a quite large penalty in\nperformance and memory consumption. Are you willing to accept?\n\n## Sections\n\n- **NAME**\n- **INHERITANCE**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **OVERLOADED**\n- **METHODS** (10 subsections)\n- **DETAILS**\n- **DIAGNOSTICS**\n- **SEE ALSO**\n- **LICENSE**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Mail::Message::Field::Full",
        "section": "",
        "mode": "perldoc",
        "summary": "Mail::Message::Field::Full - construct one smart line in a message header",
        "synopsis": "# Getting to understand the complexity of a header field ...\nmy $fast = $msg->head->get('subject');\nmy $full = Mail::Message::Field::Full->from($fast);\nmy $full = $msg->head->get('subject')->study;  # same\nmy $full = $msg->head->study('subject');       # same\nmy $full = $msg->study('subject');             # same\n# ... or build a complex header field yourself\nmy $f = Mail::Message::Field::Full->new('To');\nmy $f = Mail::Message::Field::Full->new('Subject: hi!');\nmy $f = Mail::Message::Field::Full->new(Subject => 'hi!');",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "INHERITANCE",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 15,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 12,
                "subsections": []
            },
            {
                "name": "OVERLOADED",
                "lines": 20,
                "subsections": []
            },
            {
                "name": "METHODS",
                "lines": 2,
                "subsections": [
                    {
                        "name": "Constructors",
                        "lines": 84
                    },
                    {
                        "name": "The field",
                        "lines": 24
                    },
                    {
                        "name": "Access to the name",
                        "lines": 11
                    },
                    {
                        "name": "Access to the body",
                        "lines": 26
                    },
                    {
                        "name": "Access to the content",
                        "lines": 49
                    },
                    {
                        "name": "Other methods",
                        "lines": 6
                    },
                    {
                        "name": "Internals",
                        "lines": 80
                    },
                    {
                        "name": "Parsing",
                        "lines": 39
                    },
                    {
                        "name": "Error handling",
                        "lines": 42
                    },
                    {
                        "name": "Cleanup",
                        "lines": 5
                    }
                ]
            },
            {
                "name": "DETAILS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DIAGNOSTICS",
                "lines": 29,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "LICENSE",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Mail::Message::Field::Full - construct one smart line in a message header\n",
                "subsections": []
            },
            "INHERITANCE": {
                "content": "Mail::Message::Field::Full\nis a Mail::Message::Field\nis a Mail::Reporter\n\nMail::Message::Field::Full is extended by\nMail::Message::Field::Structured\nMail::Message::Field::Unstructured\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "# Getting to understand the complexity of a header field ...\n\nmy $fast = $msg->head->get('subject');\nmy $full = Mail::Message::Field::Full->from($fast);\n\nmy $full = $msg->head->get('subject')->study;  # same\nmy $full = $msg->head->study('subject');       # same\nmy $full = $msg->study('subject');             # same\n\n# ... or build a complex header field yourself\n\nmy $f = Mail::Message::Field::Full->new('To');\nmy $f = Mail::Message::Field::Full->new('Subject: hi!');\nmy $f = Mail::Message::Field::Full->new(Subject => 'hi!');\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "This is the *full* implementation of a header field: it has *full* understanding of all\npredefined header fields. These objects will be quite slow, because header fields can be very\ncomplex. Of course, this class delivers the optimal result, but for a quite large penalty in\nperformance and memory consumption. Are you willing to accept?\n\nThis class supports the common header description from RFC2822 (formerly RFC822), the extensions\nwith respect to character set encodings as specified in RFC2047, and the extensions on language\nspecification and long parameter wrapping from RFC2231. If you do not need the latter two, then\nthe Mail::Message::Field::Fast and Mail::Message::Field::Flex are enough for your application.\n\nExtends \"DESCRIPTION\" in Mail::Message::Field.\n",
                "subsections": []
            },
            "OVERLOADED": {
                "content": "Extends \"OVERLOADED\" in Mail::Message::Field.\n\noverload: \"\"\nInherited, see \"OVERLOADED\" in Mail::Message::Field\n\noverload: 0+\nInherited, see \"OVERLOADED\" in Mail::Message::Field\n\noverload: <=>\nInherited, see \"OVERLOADED\" in Mail::Message::Field\n\noverload: bool\nInherited, see \"OVERLOADED\" in Mail::Message::Field\n\noverload: cmp\nInherited, see \"OVERLOADED\" in Mail::Message::Field\n\noverload: stringification\nIn string context, the decoded body is returned, as if decodedBody() would have been called.\n",
                "subsections": []
            },
            "METHODS": {
                "content": "Extends \"METHODS\" in Mail::Message::Field.\n",
                "subsections": [
                    {
                        "name": "Constructors",
                        "content": "Extends \"Constructors\" in Mail::Message::Field.\n\n$obj->clone()\nInherited, see \"Constructors\" in Mail::Message::Field\n\nMail::Message::Field::Full->from($field, %options)\nConvert any $field (a Mail::Message::Field object) into a new Mail::Message::Field::Full\nobject. This conversion is done the hard way: the string which is produced by the original\nobject is parsed again. Usually, the string which is parsed is exactly the line (or lines)\nas found in the original input source, which is a good thing because Full fields are much\nmore careful with the actual content.\n\n%options are passed to the constructor (see new()). In any case, some extensions of this\nFull field class is returned. It depends on which field is created what kind of class we\nget.\n\nexample:\n\nmy $fast = $msg->head->get('subject');\nmy $full = Mail::Message::Field::Full->from($fast);\n\nmy $full = $msg->head->get('subject')->study;  # same\nmy $full = $msg->head->study('subject');       # same\nmy $full = $msg->get('subject');               # same\n\nMail::Message::Field::Full->new($data)\nCreating a new field object the correct way is a lot of work, because there is so much\nfreedom in the RFCs, but at the same time so many restrictions. Most fields are implemented,\nbut if you have your own field (and do no want to contribute it to MailBox), then simply\ncall new on your own package.\n\nYou have the choice to instantiate the object as string or in prepared parts:\n\n*   new LINE, OPTIONS\n\nPass a LINE as it could be found in a file: a (possibly folded) line which is terminated\nby a new-line.\n\n*   new NAME, [BODY], OPTIONS\n\nA set of values which shape the line.\n\nThe NAME is a wellformed header name (you may use wellformedName()) to be sure about the\ncasing. The BODY is a string, one object, or an ref-array of objects. In case of objects,\nthey must fit to the constructor of the field: the types which are accepted may differ. The\noptional ATTRIBUTE list contains Mail::Message::Field::Attribute objects. Finally, there are\nsome OPTIONS.\n\n-Option  --Defined in     --Default\ncharset                    undef\nencoding                   'q'\nforce                      false\nlanguage                   undef\nlog       Mail::Reporter   'WARNINGS'\ntrace     Mail::Reporter   'WARNINGS'\n\ncharset => STRING\nThe body is specified in utf8, and must become 7-bits ascii to be transmited. Specify a\ncharset to which the multi-byte utf8 is converted before it gets encoded. See encode(),\nwhich does the job.\n\nencoding => 'q'|'Q'|'b'|'B'\nNon-ascii characters are encoded using Quoted-Printable ('q' or 'Q') or Base64 ('b' or\n'B') encoding.\n\nforce => BOOLEAN\nEnforce encoding in the specified charset, even when it is not needed because the body\ndoes not contain any non-ascii characters.\n\nlanguage => STRING\nThe language used can be specified, however is rarely used my mail clients.\n\nlog => LEVEL\ntrace => LEVEL\n\nexample:\n\nmy $s = Mail::Message::Field::Full->new('Subject: Hello World');\nmy $s = Mail::Message::Field::Full->new('Subject', 'Hello World');\n\nmy @attrs   = (Mail::Message::Field::Attribute->new(...), ...);\nmy @options = (extra => 'the color blue');\nmy $t = Mail::Message::Field::Full->new(To => \\@addrs, @attrs, @options);\n"
                    },
                    {
                        "name": "The field",
                        "content": "Extends \"The field\" in Mail::Message::Field.\n\n$obj->isStructured()\nMail::Message::Field::Full->isStructured()\nInherited, see \"The field\" in Mail::Message::Field\n\n$obj->length()\nInherited, see \"The field\" in Mail::Message::Field\n\n$obj->nrLines()\nInherited, see \"The field\" in Mail::Message::Field\n\n$obj->print( [$fh] )\nInherited, see \"The field\" in Mail::Message::Field\n\n$obj->size()\nInherited, see \"The field\" in Mail::Message::Field\n\n$obj->string( [$wrap] )\nInherited, see \"The field\" in Mail::Message::Field\n\n$obj->toDisclose()\nInherited, see \"The field\" in Mail::Message::Field\n"
                    },
                    {
                        "name": "Access to the name",
                        "content": "Extends \"Access to the name\" in Mail::Message::Field.\n\n$obj->Name()\nInherited, see \"Access to the name\" in Mail::Message::Field\n\n$obj->name()\nInherited, see \"Access to the name\" in Mail::Message::Field\n\n$obj->wellformedName( [STRING] )\nInherited, see \"Access to the name\" in Mail::Message::Field\n"
                    },
                    {
                        "name": "Access to the body",
                        "content": "Extends \"Access to the body\" in Mail::Message::Field.\n\n$obj->body()\nInherited, see \"Access to the body\" in Mail::Message::Field\n\n$obj->decodedBody(%options)\nReturns the unfolded body of the field, where encodings are resolved. The returned line will\nstill contain comments and such. The %options are passed to the decoder, see decode().\n\nBE WARNED: if the field is a structured field, the content may change syntax, because of\nencapsulated special characters. By default, the body is decoded as text, which results in a\nsmall difference within comments as well (read the RFC).\n\n$obj->folded()\nInherited, see \"Access to the body\" in Mail::Message::Field\n\n$obj->foldedBody( [$body] )\nInherited, see \"Access to the body\" in Mail::Message::Field\n\n$obj->stripCFWS( [STRING] )\nMail::Message::Field::Full->stripCFWS( [STRING] )\nInherited, see \"Access to the body\" in Mail::Message::Field\n\n$obj->unfoldedBody( [$body, [$wrap]] )\nInherited, see \"Access to the body\" in Mail::Message::Field\n"
                    },
                    {
                        "name": "Access to the content",
                        "content": "Extends \"Access to the content\" in Mail::Message::Field.\n\n$obj->addresses()\nInherited, see \"Access to the content\" in Mail::Message::Field\n\n$obj->attribute( $name, [$value] )\nInherited, see \"Access to the content\" in Mail::Message::Field\n\n$obj->attributes()\nInherited, see \"Access to the content\" in Mail::Message::Field\n\n$obj->beautify()\nFor structured header fields, this removes the original encoding of the field's body (the\nformat as it was offered to parse()), therefore the next request for the field will have to\nre-produce the read data clean and nice. For unstructured bodies, this method doesn't do a\nthing.\n\n$obj->comment( [STRING] )\nInherited, see \"Access to the content\" in Mail::Message::Field\n\n$obj->createComment(STRING, %options)\nMail::Message::Field::Full->createComment(STRING, %options)\nCreate a comment to become part in a field. Comments are automatically included within\nparenthesis. Matching pairs of parenthesis are permitted within the STRING. When a\nnon-matching parenthesis are used, it is only permitted with an escape (a backslash) in\nfront of them. These backslashes will be added automatically if needed (don't worry!).\nBackslashes will stay, except at the end, where it will be doubled.\n\nThe %options are \"charset\", \"language\", and \"encoding\" as always. The created comment is\nreturned.\n\n$obj->createPhrase(STRING, %options)\nMail::Message::Field::Full->createPhrase(STRING, %options)\nA phrase is a text which plays a well defined role. This is the main difference with\ncomments, which have do specified meaning. Some special characters in the phrase will cause\nit to be surrounded with double quotes: do not specify them yourself.\n\nThe %options are \"charset\", \"language\", and \"encoding\", as always.\n\n$obj->study()\nInherited, see \"Access to the content\" in Mail::Message::Field\n\n$obj->toDate( [$time] )\nMail::Message::Field::Full->toDate( [$time] )\nInherited, see \"Access to the content\" in Mail::Message::Field\n\n$obj->toInt()\nInherited, see \"Access to the content\" in Mail::Message::Field\n"
                    },
                    {
                        "name": "Other methods",
                        "content": "Extends \"Other methods\" in Mail::Message::Field.\n\n$obj->dateToTimestamp(STRING)\nMail::Message::Field::Full->dateToTimestamp(STRING)\nInherited, see \"Other methods\" in Mail::Message::Field\n"
                    },
                    {
                        "name": "Internals",
                        "content": "Extends \"Internals\" in Mail::Message::Field.\n\n$obj->consume( $line | <$name,<$body|$objects>> )\nInherited, see \"Internals\" in Mail::Message::Field\n\n$obj->decode(STRING, %options)\nMail::Message::Field::Full->decode(STRING, %options)\nDecode field encoded STRING to an utf8 string. The input STRING is part of a header field,\nand as such, may contain encoded words in \"=?...?.?...?=\" format defined by RFC2047. The\nSTRING may contain multiple encoded parts, maybe using different character sets.\n\nBe warned: you MUST first interpret the field into parts, like phrases and comments, and\nthen decode each part separately, otherwise the decoded text may interfere with your markup\ncharacters.\n\nBe warned: language information, which is defined in RFC2231, is ignored.\n\nEncodings with unknown charsets are left untouched [requires v2.085, otherwise croaked].\nUnknown characters within an charset are replaced by a '?'.\n\n-Option --Default\nistext  1\n\nistext => BOOLEAN\nEncoding on text is slightly more complicated than encoding structured data, because it\ncontains blanks. Visible blanks have to be ignored between two encoded words in the text,\nbut not when an encoded word follows or precedes an unencoded word. Phrases and comments\nare texts.\n\nexample:\n\nprint Mail::Message::Field::Full->decode('=?iso-8859-1?Q?J=F8rgen?=');\n# prints   JE<0slash>rgen\n\n$obj->defaultWrapLength( [$length] )\nInherited, see \"Internals\" in Mail::Message::Field\n\n$obj->encode(STRING, %options)\nEncode the (possibly utf8 encoded) STRING to a string which is acceptable to the RFC2047\ndefinition of a header: only containing us-ascii characters.\n\n-Option  --Default\ncharset   'us-ascii'\nencoding  'q'\nforce     <flase>\nlanguage  undef\nname      undef\n\ncharset => STRING\nSTRING is an utf8 string which has to be translated into any byte-wise character set for\ntransport, because MIME-headers can only contain ascii characters.\n\nencoding => 'q'|'Q'|'b'|'B'\nThe character encoding to be used. With \"q\" or \"Q\", quoted-printable encoding will be\nused. With \"b \" or \"B \", base64 encoding will be taken.\n\nforce => BOOLEAN\nEncode the string, even when it only contains us-ascii characters. By default, this is off\nbecause it decreases readibility of the produced header fields.\n\nlanguage => STRING\nRFC2231 defines how to specify language encodings in encoded words. The STRING is a\nstrandard iso language name.\n\nname => STRING\n[3.002] When the name of the field is given, the first encoded line will be shorter.\n\n$obj->fold( $name, $body, [$maxchars] )\nMail::Message::Field::Full->fold( $name, $body, [$maxchars] )\nInherited, see \"Internals\" in Mail::Message::Field\n\n$obj->setWrapLength( [$length] )\nInherited, see \"Internals\" in Mail::Message::Field\n\n$obj->stringifyData(STRING|ARRAY|$objects)\nInherited, see \"Internals\" in Mail::Message::Field\n\n$obj->unfold(STRING)\nInherited, see \"Internals\" in Mail::Message::Field\n"
                    },
                    {
                        "name": "Parsing",
                        "content": "You probably do not want to call these parsing methods yourself: use the standard constructors\n(new()) and it will be done for you.\n\n$obj->consumeComment(STRING)\nMail::Message::Field::Full->consumeComment(STRING)\nTry to read a comment from the STRING. When successful, the comment without encapsulation\nparenthesis is returned, together with the rest of the string.\n\n$obj->consumeDotAtom(STRING)\nReturns three elemens: the atom-text, the rest string, and the concatenated comments. Both\natom and comments can be undef.\n\n$obj->consumePhrase(STRING)\nMail::Message::Field::Full->consumePhrase(STRING)\nTake the STRING, and try to strip-off a valid phrase. In the obsolete phrase syntax, any\nsequence of words is accepted as phrase (as long as certain special characters are not\nused). RFC2822 is stricter: only one word or a quoted string is allowed. As always, the\nobsolete syntax is accepted, and the new syntax is produced.\n\nThis method returns two elements: the phrase (or undef) followed by the resulting string.\nThe phrase will be removed from the optional quotes. Be warned that \"\" will return an empty,\nvalid phrase.\n\nexample:\n\nmy ($phrase, $rest) = $field->consumePhrase( q[\"hi!\" <sales@example.com>] );\n\n$obj->parse(STRING)\nGet the detailed information from the STRING, and store the data found in the field object.\nThe accepted input is very field type dependent. Unstructured fields do no parsing\nwhatsoever.\n\n$obj->produceBody()\nProduce the text for the field, based on the information stored within the field object.\n\nUsually, you wish the exact same line as was found in the input source of a message. But\nwhen you have created a field yourself, it should get formatted. You may call beautify() on\na preformatted field to enforce a call to this method when the field is needed later.\n"
                    },
                    {
                        "name": "Error handling",
                        "content": "Extends \"Error handling\" in Mail::Message::Field.\n\n$obj->AUTOLOAD()\nInherited, see \"Error handling\" in Mail::Reporter\n\n$obj->addReport($object)\nInherited, see \"Error handling\" in Mail::Reporter\n\n$obj->defaultTrace( [$level]|[$loglevel, $tracelevel]|[$level, $callback] )\nMail::Message::Field::Full->defaultTrace( [$level]|[$loglevel, $tracelevel]|[$level, $callback]\n)\nInherited, see \"Error handling\" in Mail::Reporter\n\n$obj->errors()\nInherited, see \"Error handling\" in Mail::Reporter\n\n$obj->log( [$level, [$strings]] )\nMail::Message::Field::Full->log( [$level, [$strings]] )\nInherited, see \"Error handling\" in Mail::Reporter\n\n$obj->logPriority($level)\nMail::Message::Field::Full->logPriority($level)\nInherited, see \"Error handling\" in Mail::Reporter\n\n$obj->logSettings()\nInherited, see \"Error handling\" in Mail::Reporter\n\n$obj->notImplemented()\nInherited, see \"Error handling\" in Mail::Reporter\n\n$obj->report( [$level] )\nInherited, see \"Error handling\" in Mail::Reporter\n\n$obj->reportAll( [$level] )\nInherited, see \"Error handling\" in Mail::Reporter\n\n$obj->trace( [$level] )\nInherited, see \"Error handling\" in Mail::Reporter\n\n$obj->warnings()\nInherited, see \"Error handling\" in Mail::Reporter\n"
                    },
                    {
                        "name": "Cleanup",
                        "content": "Extends \"Cleanup\" in Mail::Message::Field.\n\n$obj->DESTROY()\nInherited, see \"Cleanup\" in Mail::Reporter\n"
                    }
                ]
            },
            "DETAILS": {
                "content": "Extends \"DETAILS\" in Mail::Message::Field.\n",
                "subsections": []
            },
            "DIAGNOSTICS": {
                "content": "Warning: Field content is not numerical: $content\nThe numeric value of a field is requested (for instance the \"Lines\" or \"Content-Length\"\nfields should be numerical), however the data contains weird characters.\n\nWarning: Illegal character in charset '$charset'\nThe field is created with an utf8 string which only contains data from the specified\ncharacter set. However, that character set can never be a valid name because it contains\ncharacters which are not permitted.\n\nWarning: Illegal character in field name $name\nA new field is being created which does contain characters not permitted by the RFCs. Using\nthis field in messages may break other e-mail clients or transfer agents, and therefore\nmutulate or extinguish your message.\n\nWarning: Illegal character in language '$lang'\nThe field is created with data which is specified to be in a certain language, however, the\nname of the language cannot be valid: it contains characters which are not permitted by the\nRFCs.\n\nWarning: Illegal encoding '$encoding', used 'q'\nThe RFCs only permit base64 (\"b \" or \"B \") or quoted-printable (\"q\" or \"Q\") encoding. Other\nthan these four options are illegal.\n\nError: Package $package does not implement $method.\nFatal error: the specific package (or one of its superclasses) does not implement this\nmethod where it should. This message means that some other related classes do implement this\nmethod however the class at hand does not. Probably you should investigate this and probably\ninform the author of the package.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "This module is part of Mail-Message distribution version 3.012, built on February 11, 2022.\nWebsite: http://perl.overmeer.net/CPAN/\n",
                "subsections": []
            },
            "LICENSE": {
                "content": "Copyrights 2001-2022 by [Mark Overmeer <markov@cpan.org>]. For other contributors see ChangeLog.\n\nThis program is free software; you can redistribute it and/or modify it under the same terms as\nPerl itself. See http://dev.perl.org/licenses/\n",
                "subsections": []
            }
        }
    }
}