{
    "mode": "man",
    "parameter": "perldoc",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/perldoc/1/json",
    "generated": "2026-06-15T14:23:49Z",
    "synopsis": "perldoc [-h] [-D] [-t] [-u] [-m] [-l] [-U] [-F]\n[-i] [-V] [-T] [-r]\n[-d destinationfile]\n[-o formatname]\n[-M FormatterClassName]\n[-w formatteroption:value]\n[-n nroff-replacement]\n[-X]\n[-L languagecode]\nPageName|ModuleName|ProgramName|URL\nExamples:\nperldoc -f BuiltinFunction\nperldoc -L it -f BuiltinFunction\nperldoc -q FAQ Keyword\nperldoc -L fr -q FAQ Keyword\nperldoc -v PerlVariable\nperldoc -a PerlAPI\nSee below for more description of the switches.",
    "sections": {
        "NAME": {
            "content": "perldoc - Look up Perl documentation in Pod format.\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "perldoc [-h] [-D] [-t] [-u] [-m] [-l] [-U] [-F]\n[-i] [-V] [-T] [-r]\n[-d destinationfile]\n[-o formatname]\n[-M FormatterClassName]\n[-w formatteroption:value]\n[-n nroff-replacement]\n[-X]\n[-L languagecode]\nPageName|ModuleName|ProgramName|URL\n\nExamples:\n\nperldoc -f BuiltinFunction\n\nperldoc -L it -f BuiltinFunction\n\nperldoc -q FAQ Keyword\n\nperldoc -L fr -q FAQ Keyword\n\nperldoc -v PerlVariable\n\nperldoc -a PerlAPI\n\nSee below for more description of the switches.\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "perldoc looks up documentation in .pod format that is embedded in the perl installation tree\nor in a perl script, and displays it using a variety of formatters.  This is primarily used\nfor the documentation for the perl library modules.\n\nYour system may also have man pages installed for those modules, in which case you can\nprobably just use the man(1) command.\n\nIf you are looking for a table of contents to the Perl library modules documentation, see the\nperltoc page.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-h",
                    "content": "",
                    "flag": "-h"
                },
                {
                    "name": "-D",
                    "content": "",
                    "flag": "-D"
                },
                {
                    "name": "-t",
                    "content": "probably won't look as nice.\n",
                    "flag": "-t"
                },
                {
                    "name": "-u",
                    "content": "",
                    "flag": "-u"
                },
                {
                    "name": "-m",
                    "content": "Display the entire module: both code and unformatted pod documentation.  This may be\nuseful if the docs don't explain a function in the detail you need, and you'd like to\ninspect the code directly; perldoc will find the file for you and simply hand it off for\ndisplay.\n",
                    "flag": "-m"
                },
                {
                    "name": "-l",
                    "content": "",
                    "flag": "-l"
                },
                {
                    "name": "-U",
                    "content": "is implied with -F.\n\nNOTE: Please see the heading SECURITY below for more information.\n",
                    "flag": "-U"
                },
                {
                    "name": "-F",
                    "content": "-U if run as the superuser.\n",
                    "flag": "-F"
                },
                {
                    "name": "-f",
                    "content": "The -f option followed by the name of a perl built-in function will extract the\ndocumentation of this function from perlfunc.\n\nExample:\n\nperldoc -f sprintf\n",
                    "flag": "-f"
                },
                {
                    "name": "-q",
                    "content": "The -q option takes a regular expression as an argument.  It will search the question\nheadings in perlfaq[1-9] and print the entries matching the regular expression.\n\nExample:\n\nperldoc -q shuffle\n",
                    "flag": "-q"
                },
                {
                    "name": "-a",
                    "content": "The -a option followed by the name of a perl api function will extract the documentation\nof this function from perlapi.\n\nExample:\n\nperldoc -a newHV\n",
                    "flag": "-a"
                },
                {
                    "name": "-v",
                    "content": "The -v option followed by the name of a Perl predefined variable will extract the\ndocumentation of this variable from perlvar.\n\nExamples:\n\nperldoc -v '$\"'\nperldoc -v @+\nperldoc -v DATA\n",
                    "flag": "-v"
                },
                {
                    "name": "-T",
                    "content": "to STDOUT.\n",
                    "flag": "-T"
                },
                {
                    "name": "-d",
                    "content": "This specifies that the output is to be sent neither to a pager nor to STDOUT, but is to\nbe saved to the specified filename.  Example: \"perldoc -oLaTeX -dtextwrapdocs.tex\nText::Wrap\"\n",
                    "flag": "-d"
                },
                {
                    "name": "-o",
                    "content": "This specifies that you want Perldoc to try using a Pod-formatting class for the output\nformat that you specify.  For example: \"-oman\".  This is actually just a wrapper around\nthe \"-M\" switch; using \"-oformatname\" just looks for a loadable class by adding that\nformat name (with different capitalizations) to the end of different classname prefixes.\n\nFor example, \"-oLaTeX\" currently tries all of the following classes:\nPod::Perldoc::ToLaTeX Pod::Perldoc::Tolatex Pod::Perldoc::ToLatex Pod::Perldoc::ToLATEX\nPod::Simple::LaTeX Pod::Simple::latex Pod::Simple::Latex Pod::Simple::LATEX Pod::LaTeX\nPod::latex Pod::Latex Pod::LATEX.\n",
                    "flag": "-o"
                },
                {
                    "name": "-M",
                    "content": "This specifies the module that you want to try using for formatting the pod.  The class\nmust at least provide a \"parsefromfile\" method.  For example: \"perldoc\n-MPod::Perldoc::ToChecker\".\n\nYou can specify several classes to try by joining them with commas or semicolons, as in\n\"-MTk::SuperPod;Tk::Pod\".\n",
                    "flag": "-M"
                },
                {
                    "name": "-w -w",
                    "content": "This specifies an option to call the formatter with.  For example, \"-w textsize:15\" will\ncall \"$formatter->textsize(15)\" on the formatter object before it is used to format the\nobject.  For this to be valid, the formatter class must provide such a method, and the\nvalue you pass should be valid.  (So if \"textsize\" expects an integer, and you do \"-w\ntextsize:big\", expect trouble.)\n\nYou can use \"-w optionname\" (without a value) as shorthand for \"-w optionname:TRUE\".\nThis is presumably useful in cases of on/off features like: \"-w pagenumbering\".\n\nYou can use an \"=\" instead of the \":\", as in: \"-w textsize=15\".  This might be more (or\nless) convenient, depending on what shell you use.\n",
                    "flag": "-w"
                },
                {
                    "name": "-X -X",
                    "content": "the name given on the command line in the file \"$Config{archlib}/pod.idx\". The pod.idx\nfile should contain fully qualified filenames, one per line.\n",
                    "flag": "-X"
                },
                {
                    "name": "-L",
                    "content": "This allows one to specify the language code for the desired language translation. If\nthe \"POD2::<languagecode>\" package isn't installed in your system, the switch is\nignored.  All available translation packages are to be found under the \"POD2::\"\nnamespace. See POD2::IT (or POD2::FR) to see how to create new localized \"POD2::*\"\ndocumentation packages and integrate them into Pod::Perldoc.\n",
                    "flag": "-L"
                },
                {
                    "name": "PageName|ModuleName|ProgramName|URL",
                    "content": "The item you want to look up.  Nested modules (such as \"File::Basename\") are specified\neither as \"File::Basename\" or \"File/Basename\".  You may also give a descriptive name of\na page, such as \"perlfunc\".  For URLs, HTTP and HTTPS are the only kind currently\nsupported.\n\nFor simple names like 'foo', when the normal search fails to find a matching page, a\nsearch with the \"perl\" prefix is tried as well.  So \"perldoc intro\" is enough to\nfind/render \"perlintro.pod\".\n"
                },
                {
                    "name": "-n",
                    "content": "Specify replacement for groff\n",
                    "flag": "-n"
                },
                {
                    "name": "-r",
                    "content": "",
                    "flag": "-r"
                },
                {
                    "name": "-i",
                    "content": "",
                    "flag": "-i"
                },
                {
                    "name": "-V",
                    "content": "",
                    "flag": "-V"
                }
            ]
        },
        "SECURITY": {
            "content": "Because perldoc does not run properly tainted, and is known to have security issues, when run\nas the superuser it will attempt to drop privileges by setting the effective and real IDs to\nnobody's or nouser's account, or -2 if unavailable.  If it cannot relinquish its privileges,\nit will not run.\n\nSee the \"-U\" option if you do not want this behavior but beware that there are significant\nsecurity risks if you choose to use \"-U\".\n\nSince 3.26, using \"-F\" as the superuser also implies \"-U\" as opening most files and\ntraversing directories requires privileges that are above the nobody/nogroup level.\n",
            "subsections": []
        },
        "ENVIRONMENT": {
            "content": "Any switches in the \"PERLDOC\" environment variable will be used before the command line\narguments.\n\nUseful values for \"PERLDOC\" include \"-oterm\", \"-otext\", \"-ortf\", \"-oxml\", and so on,\ndepending on what modules you have on hand; or the formatter class may be specified exactly\nwith \"-MPod::Perldoc::ToTerm\" or the like.\n\n\"perldoc\" also searches directories specified by the \"PERL5LIB\" (or \"PERLLIB\" if \"PERL5LIB\"\nis not defined) and \"PATH\" environment variables.  (The latter is so that embedded pods for\nexecutables, such as \"perldoc\" itself, are available.)\n\nIn directories where either \"Makefile.PL\" or \"Build.PL\" exist, \"perldoc\" will add \".\" and\n\"lib\" first to its search path, and as long as you're not the superuser will add \"blib\" too.\nThis is really helpful if you're working inside of a build directory and want to read through\nthe docs even if you have a version of a module previously installed.\n\n\"perldoc\" will use, in order of preference, the pager defined in \"PERLDOCPAGER\", \"MANPAGER\",\nor \"PAGER\" before trying to find a pager on its own. (\"MANPAGER\" is not used if \"perldoc\" was\ntold to display plain text or unformatted pod.)\n\nWhen using perldoc in it's \"-m\" mode (display module source code), \"perldoc\" will attempt to\nuse the pager set in \"PERLDOCSRCPAGER\".  A useful setting for this command is your favorite\neditor as in \"/usr/bin/nano\". (Don't judge me.)\n\nOne useful value for \"PERLDOCPAGER\" is \"less -+C -E\".\n\nHaving PERLDOCDEBUG set to a positive integer will make perldoc emit even more descriptive\noutput than the \"-D\" switch does; the higher the number, the more it emits.\n",
            "subsections": []
        },
        "CHANGES": {
            "content": "Up to 3.1405, the switch -v was used to produce verbose messages of perldoc operation, which\nis now enabled by -D.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "perlpod, Pod::Perldoc\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Current maintainer: Mark Allen \"<mallen@cpan.org>\"\n\nPast contributors are: brian d foy \"<bdfoy@cpan.org>\" Adriano R. Ferreira\n\"<ferreira@cpan.org>\", Sean M. Burke \"<sburke@cpan.org>\", Kenneth Albanowski\n\"<kjahds@kjahds.com>\", Andy Dougherty  \"<doughera@lafcol.lafayette.edu>\", and many others.\n\n\n\nperl v5.34.0                                 2025-07-25                                   PERLDOC(1)",
            "subsections": []
        }
    },
    "summary": "perldoc - Look up Perl documentation in Pod format.",
    "flags": [
        {
            "flag": "-h",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-D",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-t",
            "long": null,
            "arg": null,
            "description": "probably won't look as nice."
        },
        {
            "flag": "-u",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-m",
            "long": null,
            "arg": null,
            "description": "Display the entire module: both code and unformatted pod documentation. This may be useful if the docs don't explain a function in the detail you need, and you'd like to inspect the code directly; perldoc will find the file for you and simply hand it off for display."
        },
        {
            "flag": "-l",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-U",
            "long": null,
            "arg": null,
            "description": "is implied with -F. NOTE: Please see the heading SECURITY below for more information."
        },
        {
            "flag": "-F",
            "long": null,
            "arg": null,
            "description": "-U if run as the superuser."
        },
        {
            "flag": "-f",
            "long": null,
            "arg": null,
            "description": "The -f option followed by the name of a perl built-in function will extract the documentation of this function from perlfunc. Example: perldoc -f sprintf"
        },
        {
            "flag": "-q",
            "long": null,
            "arg": null,
            "description": "The -q option takes a regular expression as an argument. It will search the question headings in perlfaq[1-9] and print the entries matching the regular expression. Example: perldoc -q shuffle"
        },
        {
            "flag": "-a",
            "long": null,
            "arg": null,
            "description": "The -a option followed by the name of a perl api function will extract the documentation of this function from perlapi. Example: perldoc -a newHV"
        },
        {
            "flag": "-v",
            "long": null,
            "arg": null,
            "description": "The -v option followed by the name of a Perl predefined variable will extract the documentation of this variable from perlvar. Examples: perldoc -v '$\"' perldoc -v @+ perldoc -v DATA"
        },
        {
            "flag": "-T",
            "long": null,
            "arg": null,
            "description": "to STDOUT."
        },
        {
            "flag": "-d",
            "long": null,
            "arg": null,
            "description": "This specifies that the output is to be sent neither to a pager nor to STDOUT, but is to be saved to the specified filename. Example: \"perldoc -oLaTeX -dtextwrapdocs.tex Text::Wrap\""
        },
        {
            "flag": "-o",
            "long": null,
            "arg": null,
            "description": "This specifies that you want Perldoc to try using a Pod-formatting class for the output format that you specify. For example: \"-oman\". This is actually just a wrapper around the \"-M\" switch; using \"-oformatname\" just looks for a loadable class by adding that format name (with different capitalizations) to the end of different classname prefixes. For example, \"-oLaTeX\" currently tries all of the following classes: Pod::Perldoc::ToLaTeX Pod::Perldoc::Tolatex Pod::Perldoc::ToLatex Pod::Perldoc::ToLATEX Pod::Simple::LaTeX Pod::Simple::latex Pod::Simple::Latex Pod::Simple::LATEX Pod::LaTeX Pod::latex Pod::Latex Pod::LATEX."
        },
        {
            "flag": "-M",
            "long": null,
            "arg": null,
            "description": "This specifies the module that you want to try using for formatting the pod. The class must at least provide a \"parsefromfile\" method. For example: \"perldoc -MPod::Perldoc::ToChecker\". You can specify several classes to try by joining them with commas or semicolons, as in \"-MTk::SuperPod;Tk::Pod\"."
        },
        {
            "flag": "-w",
            "long": null,
            "arg": null,
            "description": "This specifies an option to call the formatter with. For example, \"-w textsize:15\" will call \"$formatter->textsize(15)\" on the formatter object before it is used to format the object. For this to be valid, the formatter class must provide such a method, and the value you pass should be valid. (So if \"textsize\" expects an integer, and you do \"-w textsize:big\", expect trouble.) You can use \"-w optionname\" (without a value) as shorthand for \"-w optionname:TRUE\". This is presumably useful in cases of on/off features like: \"-w pagenumbering\". You can use an \"=\" instead of the \":\", as in: \"-w textsize=15\". This might be more (or less) convenient, depending on what shell you use."
        },
        {
            "flag": "-X",
            "long": null,
            "arg": null,
            "description": "the name given on the command line in the file \"$Config{archlib}/pod.idx\". The pod.idx file should contain fully qualified filenames, one per line."
        },
        {
            "flag": "-L",
            "long": null,
            "arg": null,
            "description": "This allows one to specify the language code for the desired language translation. If the \"POD2::<languagecode>\" package isn't installed in your system, the switch is ignored. All available translation packages are to be found under the \"POD2::\" namespace. See POD2::IT (or POD2::FR) to see how to create new localized \"POD2::*\" documentation packages and integrate them into Pod::Perldoc."
        },
        {
            "flag": "-n",
            "long": null,
            "arg": null,
            "description": "Specify replacement for groff"
        },
        {
            "flag": "-r",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-i",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-V",
            "long": null,
            "arg": null,
            "description": ""
        }
    ],
    "examples": [],
    "see_also": [],
    "tldr": {
        "source": "official",
        "description": "Look up Perl documentation in `.pod` format.",
        "examples": [
            {
                "description": "View documentation for a builtin [f]unction, a [v]ariable or an [a]PI",
                "command": "perldoc -{{f|v|a}} {{name}}"
            },
            {
                "description": "Search in the [q]uestion headings of Perl FAQ",
                "command": "perldoc -q {{regex}}"
            },
            {
                "description": "Send output directly to `stdout` (by default, it is send to a pager)",
                "command": "perldoc -T {{page|module|program|url}}"
            },
            {
                "description": "Specify the language code of the desired translation",
                "command": "perldoc -L {{language_code}} {{page|module|program|url}}"
            }
        ]
    }
}