{
    "content": [
        {
            "type": "text",
            "text": "# User::grent (perldoc)\n\n## NAME\n\nUser::grent - by-name interface to Perl's built-in getgr*() functions\n\n## SYNOPSIS\n\nuse User::grent;\n$gr = getgrgid(0) or die \"No group zero\";\nif ( $gr->name eq 'wheel' && @{$gr->members} > 1 ) {\nprint \"gid zero name wheel, with other members\";\n}\nuse User::grent qw(:FIELDS);\ngetgrgid(0) or die \"No group zero\";\nif ( $grname eq 'wheel' && @grmembers > 1 ) {\nprint \"gid zero name wheel, with other members\";\n}\n$gr = getgr($whoever);\n\n## DESCRIPTION\n\nThis module's default exports override the core getgrent(), getgrgid(), and getgrnam()\nfunctions, replacing them with versions that return \"User::grent\" objects. This object has\nmethods that return the similarly named structure field name from the C's passwd structure from\ngrp.h; namely name, passwd, gid, and members (not mem). The first three return scalars, the last\nan array reference.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **NOTE**\n- **AUTHOR**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "User::grent",
        "section": "",
        "mode": "perldoc",
        "summary": "User::grent - by-name interface to Perl's built-in getgr*() functions",
        "synopsis": "use User::grent;\n$gr = getgrgid(0) or die \"No group zero\";\nif ( $gr->name eq 'wheel' && @{$gr->members} > 1 ) {\nprint \"gid zero name wheel, with other members\";\n}\nuse User::grent qw(:FIELDS);\ngetgrgid(0) or die \"No group zero\";\nif ( $grname eq 'wheel' && @grmembers > 1 ) {\nprint \"gid zero name wheel, with other members\";\n}\n$gr = getgr($whoever);",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 14,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 19,
                "subsections": []
            },
            {
                "name": "NOTE",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "User::grent - by-name interface to Perl's built-in getgr*() functions\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use User::grent;\n$gr = getgrgid(0) or die \"No group zero\";\nif ( $gr->name eq 'wheel' && @{$gr->members} > 1 ) {\nprint \"gid zero name wheel, with other members\";\n}\n\nuse User::grent qw(:FIELDS);\ngetgrgid(0) or die \"No group zero\";\nif ( $grname eq 'wheel' && @grmembers > 1 ) {\nprint \"gid zero name wheel, with other members\";\n}\n\n$gr = getgr($whoever);\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "This module's default exports override the core getgrent(), getgrgid(), and getgrnam()\nfunctions, replacing them with versions that return \"User::grent\" objects. This object has\nmethods that return the similarly named structure field name from the C's passwd structure from\ngrp.h; namely name, passwd, gid, and members (not mem). The first three return scalars, the last\nan array reference.\n\nYou may also import all the structure fields directly into your namespace as regular variables\nusing the :FIELDS import tag. (Note that this still overrides your core functions.) Access these\nfields as variables named with a preceding \"gr\". Thus, \"$groupobj->gid()\" corresponds to\n$grgid if you import the fields. Array references are available as regular array variables, so\n\"@{ $groupobj->members() }\" would be simply @grmembers.\n\nThe getgr() function is a simple front-end that forwards a numeric argument to getgrgid() and\nthe rest to getgrnam().\n\nTo access this functionality without the core overrides, pass the \"use\" an empty import list,\nand then access function functions with their full qualified names. On the other hand, the\nbuilt-ins are still available via the \"CORE::\" pseudo-package.\n",
                "subsections": []
            },
            "NOTE": {
                "content": "While this class is currently implemented using the Class::Struct module to build a struct-like\nclass, you shouldn't rely upon this.\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Tom Christiansen\n",
                "subsections": []
            }
        }
    }
}