{
    "content": [
        {
            "type": "text",
            "text": "# gperl (man)\n\n## DESCRIPTION\n\nThis  is  a  preprocessor for \u001b]8;;man:groff(1)\u001b\\groff(1)\u001b]8;;\u001b\\.  It allows the use of \u001b]8;;man:perl(7)\u001b\\perl(7)\u001b]8;;\u001b\\ code in \u001b]8;;man:groff(7)\u001b\\groff(7)\u001b]8;;\u001b\\ files.\nThe result of a Perl part can be stored in groff strings or numerical registers based on  the\narguments at a final line of a Perl part.\n\n## Sections\n\n- **Name**\n- **Synopsis** (4 subsections)\n- **Description**\n- **Perl regions** (3 subsections)\n- **Example**\n- **Authors**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "gperl",
        "section": "",
        "mode": "man",
        "summary": null,
        "synopsis": null,
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "Name",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "Synopsis",
                "lines": 2,
                "subsections": [
                    {
                        "name": "gperl -h",
                        "lines": 1
                    },
                    {
                        "name": "gperl --help",
                        "lines": 1
                    },
                    {
                        "name": "gperl -v",
                        "lines": 1
                    },
                    {
                        "name": "gperl --version",
                        "lines": 1
                    }
                ]
            },
            {
                "name": "Description",
                "lines": 9,
                "subsections": []
            },
            {
                "name": "Perl regions",
                "lines": 3,
                "subsections": [
                    {
                        "name": "Starting Perl mode",
                        "lines": 7
                    },
                    {
                        "name": "Ending Perl mode without storage",
                        "lines": 9
                    },
                    {
                        "name": "Ending Perl mode with storage",
                        "lines": 60
                    }
                ]
            },
            {
                "name": "Example",
                "lines": 25,
                "subsections": []
            },
            {
                "name": "Authors",
                "lines": 8,
                "subsections": []
            }
        ],
        "sections": {
            "Name": {
                "content": "gperl - execute Perl commands in groff documents\n",
                "subsections": []
            },
            "Synopsis": {
                "content": "gperl [file ...]\n",
                "subsections": [
                    {
                        "name": "gperl -h",
                        "content": ""
                    },
                    {
                        "name": "gperl --help",
                        "content": ""
                    },
                    {
                        "name": "gperl -v",
                        "content": ""
                    },
                    {
                        "name": "gperl --version",
                        "content": ""
                    }
                ]
            },
            "Description": {
                "content": "This  is  a  preprocessor for \u001b]8;;man:groff(1)\u001b\\groff(1)\u001b]8;;\u001b\\.  It allows the use of \u001b]8;;man:perl(7)\u001b\\perl(7)\u001b]8;;\u001b\\ code in \u001b]8;;man:groff(7)\u001b\\groff(7)\u001b]8;;\u001b\\ files.\nThe result of a Perl part can be stored in groff strings or numerical registers based on  the\narguments at a final line of a Perl part.\n\nIf  no  operands are given, or if file is “-”, gperl reads the standard input stream.  A dou‐\nble-dash argument (“--”) causes all subsequent arguments to be interpreted as file  operands,\neven if their names start with a dash.  -h and --help display a usage message, whereas -v and\n--version display version information; all exit afterward.\n",
                "subsections": []
            },
            "Perl regions": {
                "content": "Perl  parts  in  groff  files  are enclosed by two .Perl requests with different arguments, a\nstarting and an ending command.\n",
                "subsections": [
                    {
                        "name": "Starting Perl mode",
                        "content": "The starting Perl request can either be without arguments, or by a request that has the  term\nstart as its only argument.\n\n•      .Perl\n\n•      .Perl start\n"
                    },
                    {
                        "name": "Ending Perl mode without storage",
                        "content": "A  .Perl command line with an argument different from start finishes a running Perl part.  Of\ncourse, it would be reasonable to add the argument stop; that's possible, but not necessary.\n\n•      .Perl stop\n\n•      .Perl otherthanstart\nThe argument otherthanstart can additionally be used as a groff string  variable  name  for\nstorage — see next section.\n"
                    },
                    {
                        "name": "Ending Perl mode with storage",
                        "content": "A useful feature of gperl is to store one or more results from the Perl mode.\n\nThe output of a Perl part can be got with backticks `...`.\n\nThis  program collects all printing to STDOUT (normal standard output) by the Perl print pro‐\ngram.  This pseudo-printing output can have several lines, due to printed  line  breaks  with\n\\n.  By that, the output of a Perl run should be stored into a Perl array, with a single line\nfor each array member.\n\nThis Perl array output can be stored by gperl in either\n\ngroff strings\nby creating a groff command .ds\n\ngroff register\nby creating a groff command .rn\n\nThe storage modes can be determined by arguments of a final stopping .Perl command.  Each ar‐\ngument  .ds  changes  the mode into groff string and .nr changes the mode into groff register\nfor all following output parts.\n\nBy default, all output is saved as strings, so .ds is not really needed before the first  .nr\ncommand.   That suits to \u001b]8;;man:groff(7)\u001b\\groff(7)\u001b]8;;\u001b\\, because every output can be saved as groff string, but the\nregisters can be very restrictive.\n\nIn string mode, gperl generates a groff string storage line\n.ds varname content\nIn register mode the following groff command is generated\n.nr varname content\n\nWe present argument collections in the following.  You can add  as  first  argument  for  all\nstop.  We omit this additional element.\n\n.Perl .ds varname\nThis  will  store  1 output line into the groff string named varname by the automati‐\ncally created command\n.ds varname output\n\n.Perl varname\nIf varname is different from start this is equivalent to the former command,  because\nthe string mode is string with .ds command.  default.\n\n.Perl varname1 varname2\nThis  will  store  2 output lines into groff string names varname1 and varname2, be‐\ncause the default mode .ds is active, such that no .ds argument is needed.  Of course,\nthis is equivalent to\n.Perl .ds varname1 varname2\nand\n.Perl .ds varname1 .ds varname2\n\n.Perl .nr varname1 varname2\nstores both variables as register variables.  gperl generates\n.nr varname1 outputline1\n.nr varname2 outputline2\n\n.Perl .nr varname1 .ds varname2\nstores the 1st argument as register and the second as string by\n.nr varname1 outputline1\n.ds varname2 outputline2\n"
                    }
                ]
            },
            "Example": {
                "content": "A possible Perl part in a roff file could look like that:\nbefore\n.Perl start\nmy $result = 'some data';\nprint $result;\n.Perl stop .ds stringvar\nafter\n\nThis stores the result ”some data” into the roff string called stringvar, such that the fol‐\nlowing line is printed:\n.ds stringvar some data\nby gperl as food for the coming groff run.\n\nA Perl part with several outputs is:\n.Perl start\nprint ”first\\n”;\nprint ”second line\\n”;\nprint ”3\\n”;\n.Perl var1 var2 .nr var3\nThis stores 3 printed lines into 3 groff strings.  var1,var2,var3.  So  the  following  groff\ncommand lines are created:\n.ds var1 first\n.ds var2 second line\n.nr var3 3\n",
                "subsections": []
            },
            "Authors": {
                "content": "gperl was written by \u001b]8;;mailto:groff-bernd.warken-72@web.de\u001b\\Bernd Warken\u001b]8;;\u001b\\.\n\nSee also\nMan pages related to groff are \u001b]8;;man:groff(1)\u001b\\groff(1)\u001b]8;;\u001b\\, \u001b]8;;man:groff(7)\u001b\\groff(7)\u001b]8;;\u001b\\, and \u001b]8;;man:grog(1)\u001b\\grog(1)\u001b]8;;\u001b\\.\n\nDocuments related to Perl are \u001b]8;;man:perl(1)\u001b\\perl(1)\u001b]8;;\u001b\\, \u001b]8;;man:perl(7)\u001b\\perl(7)\u001b]8;;\u001b\\.\n\ngroff 1.23.0                                31 March 2024                                   gperl(1)",
                "subsections": []
            }
        }
    }
}