{
    "content": [
        {
            "type": "text",
            "text": "# Getopt::Std (perldoc)\n\n**Summary:** Getopt::Std - Process single-character switches with switch clustering\n\n**Synopsis:** use Getopt::Std;\ngetopts('oif:');  # -o & -i are boolean flags, -f takes an argument\n# Sets $opt* as a side effect.\ngetopts('oif:', \\%opts);  # options as above. Values in %opts\ngetopt('oDI');    # -o, -D & -I take arg.\n# Sets $opt* as a side effect.\ngetopt('oDI', \\%opts);    # -o, -D & -I take arg.  Values in %opts\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (9 lines)\n- **DESCRIPTION** (50 lines)\n\n## Full Content\n\n### NAME\n\nGetopt::Std - Process single-character switches with switch clustering\n\n### SYNOPSIS\n\nuse Getopt::Std;\n\ngetopts('oif:');  # -o & -i are boolean flags, -f takes an argument\n# Sets $opt* as a side effect.\ngetopts('oif:', \\%opts);  # options as above. Values in %opts\ngetopt('oDI');    # -o, -D & -I take arg.\n# Sets $opt* as a side effect.\ngetopt('oDI', \\%opts);    # -o, -D & -I take arg.  Values in %opts\n\n### DESCRIPTION\n\nThe \"getopts()\" function processes single-character switches with switch clustering. Pass one\nargument which is a string containing all switches to be recognized. For each switch found, if\nan argument is expected and provided, \"getopts()\" sets $optx (where \"x\" is the switch name) to\nthe value of the argument. If an argument is expected but none is provided, $optx is set to an\nundefined value. If a switch does not take an argument, $optx is set to 1.\n\nSwitches which take an argument don't care whether there is a space between the switch and the\nargument. If unspecified switches are found on the command-line, the user will be warned that an\nunknown option was given.\n\nThe \"getopts()\" function returns true unless an invalid option was found.\n\nThe \"getopt()\" function is similar, but its argument is a string containing all switches that\ntake an argument. If no argument is provided for a switch, say, \"y\", the corresponding $opty\nwill be set to an undefined value. Unspecified switches are silently accepted. Use of \"getopt()\"\nis not recommended.\n\nNote that, if your code is running under the recommended \"use strict vars\" pragma, you will need\nto declare these package variables with \"our\":\n\nour($optx, $opty);\n\nFor those of you who don't like additional global variables being created, \"getopt()\" and\n\"getopts()\" will also accept a hash reference as an optional second argument. Hash keys will be\n\"x\" (where \"x\" is the switch name) with key values the value of the argument or 1 if no argument\nis specified.\n\nTo allow programs to process arguments that look like switches, but aren't, both functions will\nstop processing switches when they see the argument \"--\". The \"--\" will be removed from @ARGV.\n\n\"--help\" and \"--version\"\nIf \"-\" is not a recognized switch letter, getopts() supports arguments \"--help\" and \"--version\".\nIf \"main::HELPMESSAGE()\" and/or \"main::VERSIONMESSAGE()\" are defined, they are called; the\narguments are the output file handle, the name of option-processing package, its version, and\nthe switches string. If the subroutines are not defined, an attempt is made to generate\nintelligent messages; for best results, define $main::VERSION.\n\nIf embedded documentation (in pod format, see perlpod) is detected in the script, \"--help\" will\nalso show how to access the documentation.\n\nNote that due to excessive paranoia, if $Getopt::Std::STANDARDHELPVERSION isn't true (the\ndefault is false), then the messages are printed on STDERR, and the processing continues after\nthe messages are printed. This being the opposite of the standard-conforming behaviour, it is\nstrongly recommended to set $Getopt::Std::STANDARDHELPVERSION to true.\n\nOne can change the output file handle of the messages by setting\n$Getopt::Std::OUTPUTHELPVERSION. One can print the messages of \"--help\" (without the \"Usage:\"\nline) and \"--version\" by calling functions helpmess() and versionmess() with the switches\nstring as an argument.\n\n"
        }
    ],
    "structuredContent": {
        "command": "Getopt::Std",
        "section": "",
        "mode": "perldoc",
        "summary": "Getopt::Std - Process single-character switches with switch clustering",
        "synopsis": "use Getopt::Std;\ngetopts('oif:');  # -o & -i are boolean flags, -f takes an argument\n# Sets $opt* as a side effect.\ngetopts('oif:', \\%opts);  # options as above. Values in %opts\ngetopt('oDI');    # -o, -D & -I take arg.\n# Sets $opt* as a side effect.\ngetopt('oDI', \\%opts);    # -o, -D & -I take arg.  Values in %opts",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 50,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Getopt::Std - Process single-character switches with switch clustering\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use Getopt::Std;\n\ngetopts('oif:');  # -o & -i are boolean flags, -f takes an argument\n# Sets $opt* as a side effect.\ngetopts('oif:', \\%opts);  # options as above. Values in %opts\ngetopt('oDI');    # -o, -D & -I take arg.\n# Sets $opt* as a side effect.\ngetopt('oDI', \\%opts);    # -o, -D & -I take arg.  Values in %opts\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "The \"getopts()\" function processes single-character switches with switch clustering. Pass one\nargument which is a string containing all switches to be recognized. For each switch found, if\nan argument is expected and provided, \"getopts()\" sets $optx (where \"x\" is the switch name) to\nthe value of the argument. If an argument is expected but none is provided, $optx is set to an\nundefined value. If a switch does not take an argument, $optx is set to 1.\n\nSwitches which take an argument don't care whether there is a space between the switch and the\nargument. If unspecified switches are found on the command-line, the user will be warned that an\nunknown option was given.\n\nThe \"getopts()\" function returns true unless an invalid option was found.\n\nThe \"getopt()\" function is similar, but its argument is a string containing all switches that\ntake an argument. If no argument is provided for a switch, say, \"y\", the corresponding $opty\nwill be set to an undefined value. Unspecified switches are silently accepted. Use of \"getopt()\"\nis not recommended.\n\nNote that, if your code is running under the recommended \"use strict vars\" pragma, you will need\nto declare these package variables with \"our\":\n\nour($optx, $opty);\n\nFor those of you who don't like additional global variables being created, \"getopt()\" and\n\"getopts()\" will also accept a hash reference as an optional second argument. Hash keys will be\n\"x\" (where \"x\" is the switch name) with key values the value of the argument or 1 if no argument\nis specified.\n\nTo allow programs to process arguments that look like switches, but aren't, both functions will\nstop processing switches when they see the argument \"--\". The \"--\" will be removed from @ARGV.\n\n\"--help\" and \"--version\"\nIf \"-\" is not a recognized switch letter, getopts() supports arguments \"--help\" and \"--version\".\nIf \"main::HELPMESSAGE()\" and/or \"main::VERSIONMESSAGE()\" are defined, they are called; the\narguments are the output file handle, the name of option-processing package, its version, and\nthe switches string. If the subroutines are not defined, an attempt is made to generate\nintelligent messages; for best results, define $main::VERSION.\n\nIf embedded documentation (in pod format, see perlpod) is detected in the script, \"--help\" will\nalso show how to access the documentation.\n\nNote that due to excessive paranoia, if $Getopt::Std::STANDARDHELPVERSION isn't true (the\ndefault is false), then the messages are printed on STDERR, and the processing continues after\nthe messages are printed. This being the opposite of the standard-conforming behaviour, it is\nstrongly recommended to set $Getopt::Std::STANDARDHELPVERSION to true.\n\nOne can change the output file handle of the messages by setting\n$Getopt::Std::OUTPUTHELPVERSION. One can print the messages of \"--help\" (without the \"Usage:\"\nline) and \"--version\" by calling functions helpmess() and versionmess() with the switches\nstring as an argument.\n",
                "subsections": []
            }
        }
    }
}