{
    "content": [
        {
            "type": "text",
            "text": "# Email::MIME::ContentType (perldoc)\n\n## NAME\n\nEmail::MIME::ContentType - Parse and build a MIME Content-Type or Content-Disposition Header\n\n## SYNOPSIS\n\nuse Email::MIME::ContentType;\n# Content-Type: text/plain; charset=\"us-ascii\"; format=flowed\nmy $ct = 'text/plain; charset=\"us-ascii\"; format=flowed';\nmy $data = parsecontenttype($ct);\n$data = {\ntype       => \"text\",\nsubtype    => \"plain\",\nattributes => {\ncharset => \"us-ascii\",\nformat  => \"flowed\"\n}\n};\nmy $ctnew = buildcontenttype($data);\n# text/plain; charset=us-ascii; format=flowed\n# Content-Type: application/x-stuff;\n#  title*0*=us-ascii'en'This%20is%20even%20more%20;\n#  title*1*=%2A%2A%2Afun%2A%2A%2A%20;\n#  title*2=\"isn't it!\"\nmy $ct = q(application/x-stuff;\ntitle*0*=us-ascii'en'This%20is%20even%20more%20;\ntitle*1*=%2A%2A%2Afun%2A%2A%2A%20;\ntitle*2=\"isn't it!\");\nmy $data = parsecontenttype($ct);\n$data = {\ntype       => \"application\",\nsubtype    => \"x-stuff\",\nattributes => {\ntitle => \"This is even more *fun* isn't it!\"\n}\n};\n# Content-Disposition: attachment; filename=genome.jpeg;\n#   modification-date=\"Wed, 12 Feb 1997 16:29:51 -0500\"\nmy $cd = q(attachment; filename=genome.jpeg;\nmodification-date=\"Wed, 12 Feb 1997 16:29:51 -0500\");\nmy $data = parsecontentdisposition($cd);\n$data = {\ntype       => \"attachment\",\nattributes => {\nfilename            => \"genome.jpeg\",\n\"modification-date\" => \"Wed, 12 Feb 1997 16:29:51 -0500\"\n}\n};\nmy $cdnew = buildcontentdisposition($data);\n# attachment; filename=genome.jpeg; modification-date=\"Wed, 12 Feb 1997 16:29:51 -0500\"\n\n## Sections\n\n- **NAME**\n- **VERSION**\n- **SYNOPSIS**\n- **FUNCTIONS**\n- **WARNINGS**\n- **AUTHORS**\n- **CONTRIBUTORS**\n- **COPYRIGHT AND LICENSE**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Email::MIME::ContentType",
        "section": "",
        "mode": "perldoc",
        "summary": "Email::MIME::ContentType - Parse and build a MIME Content-Type or Content-Disposition Header",
        "synopsis": "use Email::MIME::ContentType;\n# Content-Type: text/plain; charset=\"us-ascii\"; format=flowed\nmy $ct = 'text/plain; charset=\"us-ascii\"; format=flowed';\nmy $data = parsecontenttype($ct);\n$data = {\ntype       => \"text\",\nsubtype    => \"plain\",\nattributes => {\ncharset => \"us-ascii\",\nformat  => \"flowed\"\n}\n};\nmy $ctnew = buildcontenttype($data);\n# text/plain; charset=us-ascii; format=flowed\n# Content-Type: application/x-stuff;\n#  title*0*=us-ascii'en'This%20is%20even%20more%20;\n#  title*1*=%2A%2A%2Afun%2A%2A%2A%20;\n#  title*2=\"isn't it!\"\nmy $ct = q(application/x-stuff;\ntitle*0*=us-ascii'en'This%20is%20even%20more%20;\ntitle*1*=%2A%2A%2Afun%2A%2A%2A%20;\ntitle*2=\"isn't it!\");\nmy $data = parsecontenttype($ct);\n$data = {\ntype       => \"application\",\nsubtype    => \"x-stuff\",\nattributes => {\ntitle => \"This is even more *fun* isn't it!\"\n}\n};\n# Content-Disposition: attachment; filename=genome.jpeg;\n#   modification-date=\"Wed, 12 Feb 1997 16:29:51 -0500\"\nmy $cd = q(attachment; filename=genome.jpeg;\nmodification-date=\"Wed, 12 Feb 1997 16:29:51 -0500\");\nmy $data = parsecontentdisposition($cd);\n$data = {\ntype       => \"attachment\",\nattributes => {\nfilename            => \"genome.jpeg\",\n\"modification-date\" => \"Wed, 12 Feb 1997 16:29:51 -0500\"\n}\n};\nmy $cdnew = buildcontentdisposition($data);\n# attachment; filename=genome.jpeg; modification-date=\"Wed, 12 Feb 1997 16:29:51 -0500\"",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "VERSION",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 55,
                "subsections": []
            },
            {
                "name": "FUNCTIONS",
                "lines": 37,
                "subsections": []
            },
            {
                "name": "WARNINGS",
                "lines": 11,
                "subsections": []
            },
            {
                "name": "AUTHORS",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "CONTRIBUTORS",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "COPYRIGHT AND LICENSE",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Email::MIME::ContentType - Parse and build a MIME Content-Type or Content-Disposition Header\n",
                "subsections": []
            },
            "VERSION": {
                "content": "version 1.026\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use Email::MIME::ContentType;\n\n# Content-Type: text/plain; charset=\"us-ascii\"; format=flowed\nmy $ct = 'text/plain; charset=\"us-ascii\"; format=flowed';\nmy $data = parsecontenttype($ct);\n\n$data = {\ntype       => \"text\",\nsubtype    => \"plain\",\nattributes => {\ncharset => \"us-ascii\",\nformat  => \"flowed\"\n}\n};\n\nmy $ctnew = buildcontenttype($data);\n# text/plain; charset=us-ascii; format=flowed\n\n\n# Content-Type: application/x-stuff;\n#  title*0*=us-ascii'en'This%20is%20even%20more%20;\n#  title*1*=%2A%2A%2Afun%2A%2A%2A%20;\n#  title*2=\"isn't it!\"\nmy $ct = q(application/x-stuff;\ntitle*0*=us-ascii'en'This%20is%20even%20more%20;\ntitle*1*=%2A%2A%2Afun%2A%2A%2A%20;\ntitle*2=\"isn't it!\");\nmy $data = parsecontenttype($ct);\n\n$data = {\ntype       => \"application\",\nsubtype    => \"x-stuff\",\nattributes => {\ntitle => \"This is even more *fun* isn't it!\"\n}\n};\n\n\n# Content-Disposition: attachment; filename=genome.jpeg;\n#   modification-date=\"Wed, 12 Feb 1997 16:29:51 -0500\"\nmy $cd = q(attachment; filename=genome.jpeg;\nmodification-date=\"Wed, 12 Feb 1997 16:29:51 -0500\");\nmy $data = parsecontentdisposition($cd);\n\n$data = {\ntype       => \"attachment\",\nattributes => {\nfilename            => \"genome.jpeg\",\n\"modification-date\" => \"Wed, 12 Feb 1997 16:29:51 -0500\"\n}\n};\n\nmy $cdnew = buildcontentdisposition($data);\n# attachment; filename=genome.jpeg; modification-date=\"Wed, 12 Feb 1997 16:29:51 -0500\"\n",
                "subsections": []
            },
            "FUNCTIONS": {
                "content": "parsecontenttype\nThis routine is exported by default.\n\nThis routine parses email content type headers according to section 5.1 of RFC 2045 and also RFC\n2231 (Character Set and Parameter Continuations). It returns a hash as above, with entries for\nthe \"type\", the \"subtype\", and a hash of \"attributes\".\n\nFor backward compatibility with a really unfortunate misunderstanding of RFC 2045 by the early\nimplementors of this module, \"discrete\" and \"composite\" are also present in the returned\nhashref, with the values of \"type\" and \"subtype\" respectively.\n\nparsecontentdisposition\nThis routine is exported by default.\n\nThis routine parses email Content-Disposition headers according to RFC 2183 and RFC 2231. It\nreturns a hash as above, with entries for the \"type\", and a hash of \"attributes\".\n\nbuildcontenttype\nThis routine is exported by default.\n\nThis routine builds email Content-Type header according to RFC 2045 and RFC 2231. It takes a\nhash as above, with entries for the \"type\", the \"subtype\", and optionally also a hash of\n\"attributes\". It returns a string representing Content-Type header. Non-ASCII attributes are\nencoded to UTF-8 according to Character Set section of RFC 2231. Attribute which has more then\n78 ASCII characters is split into more attributes accorrding to Parameter Continuations of RFC\n2231. For compatibility reasons with clients which do not support RFC 2231, output string\ncontains also truncated ASCII version of any too long or non-ASCII attribute. Encoding to ASCII\nis done via Text::Unidecode module.\n\nbuildcontentdisposition\nThis routine is exported by default.\n\nThis routine builds email Content-Disposition header according to RFC 2182 and RFC 2231. It\ntakes a hash as above, with entries for the \"type\", and optionally also a hash of \"attributes\".\nIt returns a string representing Content-Disposition header. Non-ASCII or too long attributes\nare handled in the same way like in buildcontenttype function.\n",
                "subsections": []
            },
            "WARNINGS": {
                "content": "This is not a valid content-type header, according to both RFC 1521 and RFC 2045:\n\nContent-Type: type/subtype;\n\nIf a semicolon appears, a parameter must. \"parsecontenttype\" will carp if it encounters a\nheader of this type, but you can suppress this by setting\n$Email::MIME::ContentType::STRICTPARAMS to a false value. Please consider localizing this\nassignment!\n\nSame applies for \"parsecontentdisposition\".\n",
                "subsections": []
            },
            "AUTHORS": {
                "content": "*   Simon Cozens <simon@cpan.org>\n\n*   Casey West <casey@geeknest.com>\n\n*   Ricardo SIGNES <rjbs@cpan.org>\n",
                "subsections": []
            },
            "CONTRIBUTORS": {
                "content": "*   Matthew Green <mrg@eterna.com.au>\n\n*   Pali <pali@cpan.org>\n\n*   Ricardo Signes <rjbs@semiotic.systems>\n\n*   Thomas Szukala <ts@abusix.com>\n",
                "subsections": []
            },
            "COPYRIGHT AND LICENSE": {
                "content": "This software is copyright (c) 2004 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": []
            }
        }
    }
}