← 返回命令列表

Linux command

perldoc 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

View module documentation

perldoc [Module::Name]

Look up a built-in function

perldoc -f [function_name]

Search the FAQ for a keyword

perldoc -q "[keyword]"

Look up a built-in variable

perldoc -v '[variable]'

View a module's source code

perldoc -m [Module::Name]

Display documentation as plain text

perldoc -t [Module::Name]

View the Perl tutorial

perldoc perlintro

说明

perldoc is the standard Perl documentation viewer. It looks up and displays documentation written in POD (Plain Old Documentation) format embedded in Perl modules, scripts, and core documentation pages. When invoked with a module name, it searches @INC paths to find and render the module's POD. Without arguments, it displays its own usage. Common documentation pages include perlintro (tutorial), perlfunc (built-in functions), perlvar (special variables), perlre (regular expressions), and perlop (operators).

参数

-f _FUNCTION_
Look up a built-in Perl function by name.
-q _QUERY_
Search the Perl FAQ (perlfaq) for entries matching a regex.
-v _VARIABLE_
Look up a built-in Perl variable (e.g., -v '$!').
-m _MODULE_
Display the module source code rather than its documentation.
-t
Plain text output (no man-page formatting).
-T
Send output to STDOUT without a pager.
-l
Display the file path of the module instead of its documentation.
-U
Run in unsafe mode to allow running perldoc as root.

FAQ

What is the perldoc command used for?

perldoc is the standard Perl documentation viewer. It looks up and displays documentation written in POD (Plain Old Documentation) format embedded in Perl modules, scripts, and core documentation pages. When invoked with a module name, it searches @INC paths to find and render the module's POD. Without arguments, it displays its own usage. Common documentation pages include perlintro (tutorial), perlfunc (built-in functions), perlvar (special variables), perlre (regular expressions), and perlop (operators).

How do I run a basic perldoc example?

Run `perldoc [Module::Name]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -f _FUNCTION_ do in perldoc?

Look up a built-in Perl function by name.