{
    "mode": "perldoc",
    "parameter": "Sys::Hostname",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Sys%3A%3AHostname/json",
    "generated": "2026-06-03T07:37:53Z",
    "synopsis": "use Sys::Hostname;\n$host = hostname;",
    "sections": {
        "NAME": {
            "content": "Sys::Hostname - Try every conceivable way to get hostname\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use Sys::Hostname;\n$host = hostname;\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Attempts several methods of getting the system hostname and then caches the result. It tries the\nfirst available of the C library's gethostname(), `$Config{aphostname}`, uname(2),\n\"syscall(SYSgethostname)\", `hostname`, `uname -n`, and the file /com/host. If all that fails it\n\"croak\"s.\n\nAll NULs, returns, and newlines are removed from the result.\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "David Sundstrom <sunds@asictest.sc.ti.com>\n\nTexas Instruments\n\nXS code added by Greg Bacon <gbacon@cs.uah.edu>\n",
            "subsections": []
        }
    },
    "summary": "Sys::Hostname - Try every conceivable way to get hostname",
    "flags": [],
    "examples": [],
    "see_also": []
}