{
    "mode": "perldoc",
    "parameter": "Email::Simple::Header",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Email%3A%3ASimple%3A%3AHeader/json",
    "generated": "2026-10-05T13:58:14Z",
    "synopsis": "my $email = Email::Simple->new($text);\nmy $header = $email->headerobj;\nprint $header->asstring;",
    "sections": {
        "NAME": {
            "content": "Email::Simple::Header - the header of an Email::Simple message\n",
            "subsections": []
        },
        "VERSION": {
            "content": "version 2.218\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "my $email = Email::Simple->new($text);\n\nmy $header = $email->headerobj;\nprint $header->asstring;\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This method implements the headers of an Email::Simple object. It is a very minimal interface,\nand is mostly for private consumption at the moment.\n",
            "subsections": []
        },
        "PERL VERSION": {
            "content": "This library should run on perls released even a long time ago. It should work on any version of\nperl released in the last five years.\n\nAlthough it may work on older versions of perl, no guarantee is made that the minimum required\nversion will not be increased. The version may be increased for any reason, and there is no\npromise that patches will be accepted to lower the minimum required perl.\n",
            "subsections": []
        },
        "METHODS": {
            "content": "new\nmy $header = Email::Simple::Header->new($head, \\%arg);\n\n$head is a string containing a valid email header, or a reference to such a string. If a\nreference is passed in, don't expect that it won't be altered.\n\nValid arguments are:\n\ncrlf - the header's newline; defaults to CRLF\n\nasstring\nmy $string = $header->asstring(\\%arg);\n\nThis returns a stringified version of the header.\n\nheadernames\nThis method returns a list of the unique header names found in this header, in no particular\norder.\n\nheaderrawpairs\nmy @pairs = $header->headerrawpairs;\nmy $firstname  = $pairs[0];\nmy $firstvalue = $pairs[1];\n\nThis method returns a list of all the field/value pairs in the header, in the order that they\nappear in the header. (Remember: don't try assigning that to a hash. Some fields may appear more\nthan once!)\n\nheaderpairs\nheaderpairs is another name for headerrawpairs, which was the original name for the method\nand which you'll see most often. In general, though, it's better to be explicit and use\nheaderrawpairs. (In Email::MIME, headerstrpairs exists for letting the library do the header\ndecoding for you.)\n\nheaderraw\nmy $firstvalue = $header->headerraw($field);\nmy $nthvalue   = $header->headerraw($field, $index);\nmy @allvalues  = $header->headerraw($field);\n\nThis method returns the value or values of the given header field. If the named field does not\nappear in the header, this method returns false.\n\nheader\nThis method just calls \"headerraw\". It's the older name for \"headerraw\", but it can be a\nproblem because Email::MIME, a subclass of Email::Simple, makes \"header\" return the header's\ndecoded value.\n\nheaderrawset\n$header->headerrawset($field => @values);\n\nThis method updates the value of the given header. Existing headers have their values set in\nplace. Additional headers are added at the end. If no values are given to set, the header will\nbe removed from to the message entirely.\n\nheaderset\nheaderset is another name for headerrawset, which was the original name for the method and\nwhich you'll see most often. In general, though, it's better to be explicit and use\nheaderrawset. (In Email::MIME, headerstrset exists for letting the library do the header\nencoding for you.)\n\nheaderrawprepend\n$header->headerrawprepend($field => $value);\n\nThis method adds a new instance of the name field as the first field in the header.\n\nheaderrename\n$header->headerrename($field, $newname, $nth);\n\nThis renames the named field to the new name. If $nth is given, only the *n*th instance of the\nfield will be renamed. It is fatal to rename an instance that does not exist. The first instance\nof a header is the 0th.\n\nIf $nth is omitted, all instances of the header are renamed.\n\nWhen picking headers to rename, $field is matched case insensitively. So, given this header:\n\nhappythoughts: yes\nHappyThoughts: so many\nhapPyThouGhts: forever\n\nThen this code...\n\n$header->renameheader('happythoughts', 'Delights');\n\n...will result in this:\n\nDelights: yes\nDelights: so many\nDelights: forever\n\nHeaders may be rewrapped as a result of renaming.\n\ncrlf\nThis method returns the newline string used in the header.\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "*   Simon Cozens\n\n*   Casey West\n\n*   Ricardo SIGNES <cpan@semiotic.systems>\n",
            "subsections": []
        },
        "COPYRIGHT AND LICENSE": {
            "content": "This software is copyright (c) 2003 by Simon Cozens.\n\nThis is free software; you can redistribute it and/or modify it under the same terms as the Perl\n5 programming language system itself.\n",
            "subsections": []
        }
    },
    "summary": "Email::Simple::Header - the header of an Email::Simple message",
    "flags": [],
    "examples": [],
    "see_also": []
}