{
    "mode": "perldoc",
    "parameter": "Mail::Message::Head::Partial",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Mail%3A%3AMessage%3A%3AHead%3A%3APartial/json",
    "generated": "2026-06-16T06:33:48Z",
    "synopsis": "my $partial = $head->strip;\n$partial->isa('Mail::Message::Head')  # true\n$partial->isDelayed                      # false\n$partial->isPartial                      # true\n$partial->removeFields( qr/^X-/ );\n$partial->removeFieldsExcept( qw/To From/ );\n$partial->removeResentGroups;\n$partial->removeListGroup;\n$partial->removeSpamGroups;",
    "sections": {
        "NAME": {
            "content": "Mail::Message::Head::Partial - subset of header information of a message\n",
            "subsections": []
        },
        "INHERITANCE": {
            "content": "Mail::Message::Head::Partial\nis a Mail::Message::Head::Complete\nis a Mail::Message::Head\nis a Mail::Reporter\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "my $partial = $head->strip;\n$partial->isa('Mail::Message::Head')  # true\n$partial->isDelayed                      # false\n$partial->isPartial                      # true\n\n$partial->removeFields( qr/^X-/ );\n$partial->removeFieldsExcept( qw/To From/ );\n$partial->removeResentGroups;\n$partial->removeListGroup;\n$partial->removeSpamGroups;\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Header information consumes a considerable amount of memory. Most of this information is only\nuseful during a short period of time in your program, or sometimes it is not used at all. You\nthen can decide to remove most of the header information. However, be warned that it will be\nlost permanently: the header (and therefore the message) gets mutulated!\n\nExtends \"DESCRIPTION\" in Mail::Message::Head::Complete.\n",
            "subsections": []
        },
        "OVERLOADED": {
            "content": "Extends \"OVERLOADED\" in Mail::Message::Head::Complete.\n\noverload: \"\"\nInherited, see \"OVERLOADED\" in Mail::Message::Head\n\noverload: bool\nInherited, see \"OVERLOADED\" in Mail::Message::Head\n",
            "subsections": []
        },
        "METHODS": {
            "content": "Extends \"METHODS\" in Mail::Message::Head::Complete.\n",
            "subsections": [
                {
                    "name": "Constructors",
                    "content": "Extends \"Constructors\" in Mail::Message::Head::Complete.\n\nMail::Message::Head::Partial->build( [PAIR|$field], ... )\nInherited, see \"Constructors\" in Mail::Message::Head::Complete\n\n$obj->clone( [@names|ARRAY|Regexps] )\nInherited, see \"Constructors\" in Mail::Message::Head::Complete\n\nMail::Message::Head::Partial->new(%options)\nInherited, see \"Constructors\" in Mail::Message::Head\n"
                },
                {
                    "name": "The header",
                    "content": "Extends \"The header\" in Mail::Message::Head::Complete.\n\n$obj->isDelayed()\nInherited, see \"The header\" in Mail::Message::Head\n\n$obj->isEmpty()\nInherited, see \"The header\" in Mail::Message::Head\n\n$obj->isModified()\nInherited, see \"The header\" in Mail::Message::Head\n\n$obj->knownNames()\nInherited, see \"The header\" in Mail::Message::Head\n\n$obj->message( [$message] )\nInherited, see \"The header\" in Mail::Message::Head\n\n$obj->modified( [BOOLEAN] )\nInherited, see \"The header\" in Mail::Message::Head\n\n$obj->nrLines()\nInherited, see \"The header\" in Mail::Message::Head::Complete\n\n$obj->orderedFields()\nInherited, see \"The header\" in Mail::Message::Head\n\n$obj->size()\nInherited, see \"The header\" in Mail::Message::Head::Complete\n\n$obj->wrap($integer)\nInherited, see \"The header\" in Mail::Message::Head::Complete\n"
                },
                {
                    "name": "Access to the header",
                    "content": "Extends \"Access to the header\" in Mail::Message::Head::Complete.\n\n$obj->add( $field | $line | <$name, $body, [$attrs]> )\nInherited, see \"Access to the header\" in Mail::Message::Head::Complete\n\n$obj->addListGroup($object)\nInherited, see \"Access to the header\" in Mail::Message::Head::Complete\n\n$obj->addResentGroup($resentgroup|$data)\nInherited, see \"Access to the header\" in Mail::Message::Head::Complete\n\n$obj->addSpamGroup($object)\nInherited, see \"Access to the header\" in Mail::Message::Head::Complete\n\n$obj->cleanupOrderedFields()\nThe header maintains a list of fields which are ordered in sequence of definition. It is\nrequired to maintain the header order to keep the related fields of resent groups together.\nThe fields are also included in a hash, sorted on their name for fast access.\n\nThe references to field objects in the hash are real, those in the ordered list are weak. So\nwhen field objects are removed from the hash, their references in the ordered list are\nautomagically undef'd.\n\nWhen many fields are removed, for instance with removeFields() or removeFieldsExcept(), then\nit is useful to remove the list of undefs from the ordered list as well. In those cases,\nthis method is called automatically, however you may have your own reasons to call this\nmethod.\n\n$obj->count($name)\nInherited, see \"Access to the header\" in Mail::Message::Head::Complete\n\n$obj->delete($name)\nInherited, see \"Access to the header\" in Mail::Message::Head::Complete\n\n$obj->get( $name, [$index] )\nInherited, see \"Access to the header\" in Mail::Message::Head\n\n$obj->grepNames( [@names|ARRAY|Regexps] )\nInherited, see \"Access to the header\" in Mail::Message::Head::Complete\n\n$obj->listGroup()\nInherited, see \"Access to the header\" in Mail::Message::Head::Complete\n\n$obj->names()\nInherited, see \"Access to the header\" in Mail::Message::Head::Complete\n\n$obj->print( [$fh] )\nInherited, see \"Access to the header\" in Mail::Message::Head::Complete\n\n$obj->printSelected($fh, <STRING|Regexp>, ...)\nInherited, see \"Access to the header\" in Mail::Message::Head::Complete\n\n$obj->printUndisclosed( [$fh] )\nInherited, see \"Access to the header\" in Mail::Message::Head::Complete\n\n$obj->removeContentInfo()\nInherited, see \"Access to the header\" in Mail::Message::Head::Complete\n\n$obj->removeField($field)\nInherited, see \"Access to the header\" in Mail::Message::Head::Complete\n\n$obj->removeFields( <STRING|Regexp>, ... )\nRemove the fields from the header which are exactly named 'STRING' (case insensitive) or\nmatch the regular expresssion. Do not forget to add the 'i' modifier to the regexp, because\nfields are case insensitive.\n\nSee also removeField() which is used to remove one field object from the header. The reverse\nspecification can be made with \"removeFieldsExcept()\".\n\nexample:\n\n$head->removeFields('bcc', 'received');\n$head->removeFields( qr/^content-/i );\n\n$obj->removeFieldsExcept(STRING|Regexp, ...)\nRemove all fields from the header which are not equivalent to one of the specified STRINGs\n(case-insensitive) and which are not matching one of the REGular EXPressions. Do not forget\nto add the 'i' modifier to the Regexp, because fields are case insensitive.\n\nSee also removeField() which is used to remove one field object from the header. The reverse\nspecification can be made with \"removeFields()\".\n\nexample:\n\n$head->removeFieldsExcept('subject', qr/^content-/i );\n$head->removeFieldsExcept( qw/subject to from sender cc/ );\n\n$obj->removeListGroup()\nRemoves all header lines which are used to administer mailing lists. Which fields that are\nis explained in Mail::Message::Head::ListGroup. Returned is the number of removed lines.\n\n$obj->removeResentGroups()\nRemoves all header lines which are member of a *resent group*, which are explained in\nMail::Message::Head::ResentGroup. Returned is the number of removed lines.\n\nFor removing single groups (for instance because you want to keep the last), use\nMail::Message::Head::FieldGroup::delete().\n\n$obj->removeSpamGroups()\nRemoves all header lines which were produced by spam detection and spam-fighting software.\nWhich fields that are is explained in Mail::Message::Head::SpamGroup. Returned is the number\nof removed lines.\n\n$obj->resentGroups()\nInherited, see \"Access to the header\" in Mail::Message::Head::Complete\n\n$obj->reset($name, @fields)\nInherited, see \"Access to the header\" in Mail::Message::Head::Complete\n\n$obj->set( $field | $line | <$name, $body, [$attrs]> )\nInherited, see \"Access to the header\" in Mail::Message::Head::Complete\n\n$obj->spamDetected()\nInherited, see \"Access to the header\" in Mail::Message::Head::Complete\n\n$obj->spamGroups( [$names] )\nInherited, see \"Access to the header\" in Mail::Message::Head::Complete\n\n$obj->string()\nInherited, see \"Access to the header\" in Mail::Message::Head::Complete\n\n$obj->study( $name, [$index] )\nInherited, see \"Access to the header\" in Mail::Message::Head\n"
                },
                {
                    "name": "About the body",
                    "content": "Extends \"About the body\" in Mail::Message::Head::Complete.\n\n$obj->guessBodySize()\nInherited, see \"About the body\" in Mail::Message::Head\n\n$obj->guessTimeStamp()\nInherited, see \"About the body\" in Mail::Message::Head::Complete\n\n$obj->isMultipart()\nInherited, see \"About the body\" in Mail::Message::Head\n\n$obj->recvstamp()\nInherited, see \"About the body\" in Mail::Message::Head::Complete\n\n$obj->timestamp()\nInherited, see \"About the body\" in Mail::Message::Head::Complete\n"
                },
                {
                    "name": "Internals",
                    "content": "Extends \"Internals\" in Mail::Message::Head::Complete.\n\n$obj->addNoRealize($field)\nInherited, see \"Internals\" in Mail::Message::Head\n\n$obj->addOrderedFields($fields)\nInherited, see \"Internals\" in Mail::Message::Head\n\n$obj->createFromLine()\nInherited, see \"Internals\" in Mail::Message::Head::Complete\n\n$obj->createMessageId()\nInherited, see \"Internals\" in Mail::Message::Head::Complete\n\n$obj->fileLocation()\nInherited, see \"Internals\" in Mail::Message::Head\n\n$obj->load()\nInherited, see \"Internals\" in Mail::Message::Head\n\n$obj->messageIdPrefix( [$prefix, [$hostname]|CODE] )\nMail::Message::Head::Partial->messageIdPrefix( [$prefix, [$hostname]|CODE] )\nInherited, see \"Internals\" in Mail::Message::Head::Complete\n\n$obj->moveLocation($distance)\nInherited, see \"Internals\" in Mail::Message::Head\n\n$obj->read($parser)\nInherited, see \"Internals\" in Mail::Message::Head\n\n$obj->setNoRealize($field)\nInherited, see \"Internals\" in Mail::Message::Head\n"
                },
                {
                    "name": "Error handling",
                    "content": "Extends \"Error handling\" in Mail::Message::Head::Complete.\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::Head::Partial->defaultTrace( [$level]|[$loglevel, $tracelevel]|[$level,\n$callback] )\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::Head::Partial->log( [$level, [$strings]] )\nInherited, see \"Error handling\" in Mail::Reporter\n\n$obj->logPriority($level)\nMail::Message::Head::Partial->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::Head::Complete.\n\n$obj->DESTROY()\nInherited, see \"Cleanup\" in Mail::Reporter\n"
                }
            ]
        },
        "DETAILS": {
            "content": "Extends \"DETAILS\" in Mail::Message::Head::Complete.\n",
            "subsections": [
                {
                    "name": "Ordered header fields",
                    "content": "Extends \"Ordered header fields\" in Mail::Message::Head::Complete.\n"
                },
                {
                    "name": "Head class implementation",
                    "content": "Extends \"Head class implementation\" in Mail::Message::Head::Complete.\n"
                },
                {
                    "name": "Subsets of header fields",
                    "content": "Extends \"Subsets of header fields\" in Mail::Message::Head::Complete.\n"
                },
                {
                    "name": "Reducing the header size",
                    "content": "A message header is very large in memory and quite large on disk, and therefore a good candidate\nfor size reduction. One way to reduce the size is by simply eliminating superfluous header\nfields. Each field requires at least 100 bytes of run-time memory, so this may help!\n\nBefore you start playing around with removeFields() and removeFieldsExcept(), you may take a\nlook at two large groups of fields which can be removes as sets: the resent headers and the\nmailinglist headers.\n\nResent headers describe the intermediate steps in the transmission process for the messages.\nAfter successful delivery, they are rarely useful.\n\nWhen you are archiving a mailinglist, it is hardly ever useful to store a the list\nadministration lines for each message as well.\n\n. see examples/reduce.pl in distribution\n\nforeach my $msg ($folder->messages)\n{  $msg->head->removeResentGroups;\n$msg->head->removeResentList;\n}\n"
                }
            ]
        },
        "DIAGNOSTICS": {
            "content": "Warning: Cannot remove field $name from header: not found.\nYou ask to remove a field which is not known in the header. Using delete(), reset(), or\nset() to do the job will not result in warnings: those methods check the existence of the\nfield first.\n\nWarning: Field objects have an implied name ($name)\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": []
        }
    },
    "summary": "Mail::Message::Head::Partial - subset of header information of a message",
    "flags": [],
    "examples": [],
    "see_also": []
}