{
    "content": [
        {
            "type": "text",
            "text": "# Text::ParseWords (perldoc)\n\n## NAME\n\nText::ParseWords - parse text into an array of tokens or array of arrays\n\n## SYNOPSIS\n\nuse Text::ParseWords;\n@lists = nestedquotewords($delim, $keep, @lines);\n@words = quotewords($delim, $keep, @lines);\n@words = shellwords(@lines);\n@words = parseline($delim, $keep, $line);\n@words = oldshellwords(@lines); # DEPRECATED!\n\n## DESCRIPTION\n\nThe &nestedquotewords() and &quotewords() functions accept a delimiter (which can be a regular\nexpression) and a list of lines and then breaks those lines up into a list of words ignoring\ndelimiters that appear inside quotes. &quotewords() returns all of the tokens in a single long\nlist, while &nestedquotewords() returns a list of token lists corresponding to the elements of\n@lines. &parseline() does tokenizing on a single string. The &*quotewords() functions simply\ncall &parseline(), so if you're only splitting one line you can call &parseline() directly and\nsave a function call.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **EXAMPLES**\n- **SEE ALSO**\n- **AUTHORS**\n- **COPYRIGHT AND LICENSE**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Text::ParseWords",
        "section": "",
        "mode": "perldoc",
        "summary": "Text::ParseWords - parse text into an array of tokens or array of arrays",
        "synopsis": "use Text::ParseWords;\n@lists = nestedquotewords($delim, $keep, @lines);\n@words = quotewords($delim, $keep, @lines);\n@words = shellwords(@lines);\n@words = parseline($delim, $keep, $line);\n@words = oldshellwords(@lines); # DEPRECATED!",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [
            "The sample program:",
            "use Text::ParseWords;",
            "@words = quotewords('\\s+', 0, q{this   is \"a test\" of\\ quotewords \\\"for you});",
            "$i = 0;",
            "foreach (@words) {",
            "print \"$i: <$>\\n\";",
            "$i++;",
            "produces:",
            "0: <this>",
            "1: <is>",
            "2: <a test>",
            "3: <of quotewords>",
            "4: <\"for>",
            "5: <you>",
            "demonstrating:",
            "0   a simple word",
            "1   multiple spaces are skipped because of our $delim",
            "2   use of quotes to include a space in a word",
            "3   use of a backslash to include a space in a word",
            "4   use of a backslash to remove the special meaning of a double-quote",
            "5   another simple word (note the lack of effect of the backslashed double-quote)",
            "Replacing \"quotewords('\\s+', 0, q{this is...})\" with \"shellwords(q{this is...})\" is a simpler",
            "way to accomplish the same thing."
        ],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 7,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 21,
                "subsections": []
            },
            {
                "name": "EXAMPLES",
                "lines": 36,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "AUTHORS",
                "lines": 13,
                "subsections": []
            },
            {
                "name": "COPYRIGHT AND LICENSE",
                "lines": 3,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Text::ParseWords - parse text into an array of tokens or array of arrays\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use Text::ParseWords;\n@lists = nestedquotewords($delim, $keep, @lines);\n@words = quotewords($delim, $keep, @lines);\n@words = shellwords(@lines);\n@words = parseline($delim, $keep, $line);\n@words = oldshellwords(@lines); # DEPRECATED!\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "The &nestedquotewords() and &quotewords() functions accept a delimiter (which can be a regular\nexpression) and a list of lines and then breaks those lines up into a list of words ignoring\ndelimiters that appear inside quotes. &quotewords() returns all of the tokens in a single long\nlist, while &nestedquotewords() returns a list of token lists corresponding to the elements of\n@lines. &parseline() does tokenizing on a single string. The &*quotewords() functions simply\ncall &parseline(), so if you're only splitting one line you can call &parseline() directly and\nsave a function call.\n\nThe $keep argument is a boolean flag. If true, then the tokens are split on the specified\ndelimiter, but all other characters (including quotes and backslashes) are kept in the tokens.\nIf $keep is false then the &*quotewords() functions remove all quotes and backslashes that are\nnot themselves backslash-escaped or inside of single quotes (i.e., &quotewords() tries to\ninterpret these characters just like the Bourne shell). NB: these semantics are significantly\ndifferent from the original version of this module shipped with Perl 5.000 through 5.004. As an\nadditional feature, $keep may be the keyword \"delimiters\" which causes the functions to preserve\nthe delimiters in each string as tokens in the token lists, in addition to preserving quote and\nbackslash characters.\n\n&shellwords() is written as a special case of &quotewords(), and it does token parsing with\nwhitespace as a delimiter-- similar to most Unix shells.\n",
                "subsections": []
            },
            "EXAMPLES": {
                "content": "The sample program:\n\nuse Text::ParseWords;\n@words = quotewords('\\s+', 0, q{this   is \"a test\" of\\ quotewords \\\"for you});\n$i = 0;\nforeach (@words) {\nprint \"$i: <$>\\n\";\n$i++;\n}\n\nproduces:\n\n0: <this>\n1: <is>\n2: <a test>\n3: <of quotewords>\n4: <\"for>\n5: <you>\n\ndemonstrating:\n\n0   a simple word\n\n1   multiple spaces are skipped because of our $delim\n\n2   use of quotes to include a space in a word\n\n3   use of a backslash to include a space in a word\n\n4   use of a backslash to remove the special meaning of a double-quote\n\n5   another simple word (note the lack of effect of the backslashed double-quote)\n\nReplacing \"quotewords('\\s+', 0, q{this is...})\" with \"shellwords(q{this is...})\" is a simpler\nway to accomplish the same thing.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "Text::CSV - for parsing CSV files\n",
                "subsections": []
            },
            "AUTHORS": {
                "content": "Maintainer: Alexandr Ciornii <alexchornyATgmail.com>.\n\nPrevious maintainer: Hal Pomeranz <pomeranz@netcom.com>, 1994-1997 (Original author unknown).\nMuch of the code for &parseline() (including the primary regexp) from Joerk Behrends\n<jbehrends@multimediaproduzenten.de>.\n\nExamples section another documentation provided by John Heidemann <johnh@ISI.EDU>\n\nBug reports, patches, and nagging provided by lots of folks-- thanks everybody! Special thanks\nto Michael Schwern <schwern@envirolink.org> for assuring me that a &nestedquotewords() would be\nuseful, and to Jeff Friedl <jfriedl@yahoo-inc.com> for telling me not to worry about\nerror-checking (sort of-- you had to be there).\n",
                "subsections": []
            },
            "COPYRIGHT AND LICENSE": {
                "content": "This library is free software; you may redistribute and/or modify it under the same terms as\nPerl itself.\n",
                "subsections": []
            }
        }
    }
}