{
    "content": [
        {
            "type": "text",
            "text": "# Mail::Cap (perldoc)\n\n## NAME\n\nMail::Cap - understand mailcap files\n\n## SYNOPSIS\n\nmy $mc   = Mail::Cap->new;\nmy $desc = $mc->description('image/gif');\nprint \"GIF desc: $desc\\n\";\nmy $cmd  = $mc->viewCmd('text/plain; charset=iso-8859-1', 'file.txt');\n\n## DESCRIPTION\n\nParse mailcap files as specified in \"RFC 1524 --A User Agent Configuration Mechanism For\nMultimedia Mail Format Information>. In the description below $type refers to the MIME type as\nspecified in the \"Content-Type\" header of mail or HTTP messages. Examples of types are:\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **METHODS** (4 subsections)\n- **SEE ALSO**\n- **AUTHORS**\n- **LICENSE**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Mail::Cap",
        "section": "",
        "mode": "perldoc",
        "summary": "Mail::Cap - understand mailcap files",
        "synopsis": "my $mc   = Mail::Cap->new;\nmy $desc = $mc->description('image/gif');\nprint \"GIF desc: $desc\\n\";\nmy $cmd  = $mc->viewCmd('text/plain; charset=iso-8859-1', 'file.txt');",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 7,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 12,
                "subsections": []
            },
            {
                "name": "METHODS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "Constructors",
                        "lines": 25
                    },
                    {
                        "name": "Run commands",
                        "lines": 9
                    },
                    {
                        "name": "Command creator",
                        "lines": 9
                    },
                    {
                        "name": "Look-up definitions",
                        "lines": 10
                    }
                ]
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "AUTHORS",
                "lines": 7,
                "subsections": []
            },
            {
                "name": "LICENSE",
                "lines": 6,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Mail::Cap - understand mailcap files\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "my $mc   = Mail::Cap->new;\n\nmy $desc = $mc->description('image/gif');\nprint \"GIF desc: $desc\\n\";\n\nmy $cmd  = $mc->viewCmd('text/plain; charset=iso-8859-1', 'file.txt');\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "Parse mailcap files as specified in \"RFC 1524 --A User Agent Configuration Mechanism For\nMultimedia Mail Format Information>. In the description below $type refers to the MIME type as\nspecified in the \"Content-Type\" header of mail or HTTP messages. Examples of types are:\n\nimage/gif\ntext/html\ntext/plain; charset=iso-8859-1\n\nYou could also take a look at the File::MimeInfo distribution, which are accessing tables which\nare used by many applications on a system, and therefore have succeeded the mail-cap\nspecifications on modern (UNIX) systems.\n",
                "subsections": []
            },
            "METHODS": {
                "content": "",
                "subsections": [
                    {
                        "name": "Constructors",
                        "content": "Mail::Cap->new(%options)\nCreate and initialize a new Mail::Cap object. If you give it an argument it will try to\nparse the specified file. Without any arguments it will search for the mailcap file using\nthe standard mailcap path, or the MAILCAPS environment variable if it is defined.\n\n-Option  --Default\nfilename  undef\ntake      'FIRST'\n\nfilename => FILENAME\nAdd the specified file to the list to standard locations. This file is tried first.\n\ntake => 'ALL'|'FIRST'\nInclude all mailcap files you can find. By default, only the first file is parsed, however\nthe RFC tells us to include ALL. To maintain backwards compatibility, the default only\ntakes the FIRST.\n\nexample:\n\n$mcap = new Mail::Cap;\n$mcap = new Mail::Cap \"/mydir/mailcap\";\n$mcap = new Mail::Cap filename => \"/mydir/mailcap\";\n$mcap = new Mail::Cap take => 'ALL';\n$mcap = Mail::Cap->new(take => 'ALL');\n"
                    },
                    {
                        "name": "Run commands",
                        "content": "These methods invoke a suitable program presenting or manipulating the media object in the\nspecified file. They all return 1 if a command was found, and 0 otherwise. You might test $? for\nthe outcome of the command.\n\n$obj->compose($type, $file)\n$obj->edit($type, $file)\n$obj->print($type, $file)\n$obj->view($type, $file)\n"
                    },
                    {
                        "name": "Command creator",
                        "content": "These methods return a string that is suitable for feeding to system() in order to invoke a\nsuitable program presenting or manipulating the media object in the specified file. It will\nreturn \"undef\" if no suitable specification exists.\n\n$obj->composeCmd($type, $file)\n$obj->editCmd($type, $file)\n$obj->printCmd($type, $file)\n$obj->viewCmd($type, $file)\n"
                    },
                    {
                        "name": "Look-up definitions",
                        "content": "Methods return the corresponding mailcap field for the type.\n\n$obj->description($type)\n$obj->field($type, $field)\nReturns the specified field for the type. Returns undef if no specification exists.\n\n$obj->nametemplate($type)\n$obj->textualnewlines($type)\n$obj->x11bitmap($type)\n"
                    }
                ]
            },
            "SEE ALSO": {
                "content": "This module is part of the MailTools distribution, http://perl.overmeer.net/mailtools/.\n",
                "subsections": []
            },
            "AUTHORS": {
                "content": "The MailTools bundle was developed by Graham Barr. Later, Mark Overmeer took over maintenance\nwithout commitment to further development.\n\nMail::Cap by Gisle Aas <aas@oslonett.no>. Mail::Field::AddrList by Peter Orbaek <poe@cit.dk>.\nMail::Mailer and Mail::Send by Tim Bunce <Tim.Bunce@ig.co.uk>. For other contributors see\nChangeLog.\n",
                "subsections": []
            },
            "LICENSE": {
                "content": "Copyrights 1995-2000 Graham Barr <gbarr@pobox.com> and 2001-2017 Mark Overmeer\n<perl@overmeer.net>.\n\nThis program is free software; you can redistribute it and/or modify it under the same terms as\nPerl itself. See http://www.perl.com/perl/misc/Artistic.html\n",
                "subsections": []
            }
        }
    }
}