{
    "content": [
        {
            "type": "text",
            "text": "# Net::protoent (perldoc)\n\n## NAME\n\nNet::protoent - by-name interface to Perl's built-in getproto*() functions\n\n## SYNOPSIS\n\nuse Net::protoent;\n$p = getprotobyname(shift || 'tcp') || die \"no proto\";\nprintf \"proto for %s is %d, aliases are %s\\n\",\n$p->name, $p->proto, \"@{$p->aliases}\";\nuse Net::protoent qw(:FIELDS);\ngetprotobyname(shift || 'tcp') || die \"no proto\";\nprint \"proto for $pname is $pproto, aliases are @paliases\\n\";\n\n## DESCRIPTION\n\nThis module's default exports override the core getprotoent(), getprotobyname(), and\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION** (2 subsections)\n- **NOTE**\n- **AUTHOR**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Net::protoent",
        "section": "",
        "mode": "perldoc",
        "summary": "Net::protoent - by-name interface to Perl's built-in getproto*() functions",
        "synopsis": "use Net::protoent;\n$p = getprotobyname(shift || 'tcp') || die \"no proto\";\nprintf \"proto for %s is %d, aliases are %s\\n\",\n$p->name, $p->proto, \"@{$p->aliases}\";\nuse Net::protoent qw(:FIELDS);\ngetprotobyname(shift || 'tcp') || die \"no proto\";\nprint \"proto for $pname is $pproto, aliases are @paliases\\n\";",
        "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": 1,
                "subsections": [
                    {
                        "name": "getnetbyport",
                        "lines": 11
                    },
                    {
                        "name": "getprotobyport",
                        "lines": 4
                    }
                ]
            },
            {
                "name": "NOTE",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Net::protoent - by-name interface to Perl's built-in getproto*() functions\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use Net::protoent;\n$p = getprotobyname(shift || 'tcp') || die \"no proto\";\nprintf \"proto for %s is %d, aliases are %s\\n\",\n$p->name, $p->proto, \"@{$p->aliases}\";\n\nuse Net::protoent qw(:FIELDS);\ngetprotobyname(shift || 'tcp') || die \"no proto\";\nprint \"proto for $pname is $pproto, aliases are @paliases\\n\";\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "This module's default exports override the core getprotoent(), getprotobyname(), and",
                "subsections": [
                    {
                        "name": "getnetbyport",
                        "content": "take default second arguments of \"tcp\". This object has methods that return the similarly named\nstructure field name from the C's protoent structure from netdb.h; namely name, aliases, and\nproto. The aliases method returns an array reference, the rest scalars.\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 \"p\". Thus, \"$protoobj->name()\" corresponds to\n$pname if you import the fields. Array references are available as regular array variables, so\nfor example \"@{ $protoobj->aliases() }\" would be simply @paliases.\n\nThe getproto() function is a simple front-end that forwards a numeric argument to"
                    },
                    {
                        "name": "getprotobyport",
                        "content": "To 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"
                    }
                ]
            },
            "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": []
            }
        }
    }
}