如何运行Perl和查看帮助

 我来答
总西语B
2017-06-08 · TA获得超过726个赞
知道小有建树答主
回答量:646
采纳率:40%
帮助的人:281万
展开全部
在装好了Perl的电脑上,运行perldoc即可查看。
首先可以输入perldoc perl查看perl概览。
输入perldoc perldoc查看perldoc的用法。
perldoc -f PerlFunc即可查看perl的函数说明;
例如perldoc -f lc,就可以查看函数lc的说明。
输入perldoc perlfaq1,把1变成1..9可以查看perl如下常见问题答疑;
perlfaq1 - General Questions About Perl
perlfaq2 - Obtaining and Learning about Perl
perlfaq3 - Programming Tools
perlfaq4 - Data Manipulation
perlfaq5 - Files and Formats
perlfaq6 - Regular Expressions
perlfaq7 - General Perl Language Issues
perlfaq8 - System Interaction
perlfaq9 - Web, Email and Networking
输入perldoc ModuleName可以查看perl模块自带说明;
例如 perldoc Tk::Hlistplus可以查看Tk::Hlistplus这个模块自带的使用说明文档。(当然如果这个模块没有安装,则会显示No documentation found for Tk::Hlistplus)。

例如输入perldoc perlreftut可以查看perl的引用教程,把perlreftut换成如下,可以查看这些条目的perl官方教程:
perlreftut - Mark's very short tutorial about references
perldsc - data structure complex data structure struct
perllol - Manipulating Arrays of Arrays in Perl
perlrequick - Perl regular expressions quick start
perlretut - Perl regular expressions tutorial
perlboot - Links to information on object-oriented programming in Perl
perlootut - Object-Oriented Programming in Perl Tutorial
perltoot - Links to information on object-oriented programming in Perl
perltooc - Links to information on object-oriented programming in Perl
perlbot - Links to information on object-oriented programming in Perl
perlstyle - Perl style guide
perlcheat - Perl 5 Cheat Sheet
perltrap - Perl traps for the unwary
perldebtut - Perl debugging tutorial
perlopentut - simple recipes for opening files and pipes in Perl
perlpacktut - tutorial on pack and unpack
perlthrtut - Tutorial on threads in Perl
perlxstut - Tutorial for writing XSUBs
perlunitut - Perl Unicode Tutorial
perlpragma - how to write a user pragma
输入perldoc 如下关键词可以查看perl参考;例如输入perldoc perlvar可以查看系统预定义的perl变量说明:
perlsyn - syntax
perldata - Perl data types
perlsub - subroutine function
perlop - operator
perlfunc - function
perlpod - POD plain old documentation
perlpodspec - Plain Old Documentation: format specification and notes
perlpodstyle - Perl POD style guide
perldiag - various Perl diagnostics
perllexwarn - Perl Lexical Warnings
perldebug - debug debugger
perlvar - Perl predefined variables
perlre - regular expression regex regexp
perlreref - Perl Regular Expressions Reference
perlrebackslash - Perl Regular Expression Backslash Sequences and Escapes
perlrecharclass - character class
perlref - reference pointer data structure structure struct
perlform - format report chart
perlobj - object OOP
perltie - tie
perldbmfilter - Perl DBM Filters
perlipc - Perl interprocess communication (signals, fifos, pipes, safe subprocesses, sockets, and semaphores)
perlfork - Perl's fork() emulation
perlnumber - semantics of numbers and numeric operations in Perl
perlperf - Perl Performance and Optimization Techniques
perlport - Writing portable Perl
perllocale - Perl locale handling (internationalization and localization)
perluniintro - Perl Unicode introduction
perlunicode - Unicode support in Perl
perluniprops - Index of Unicode Version 8.0.0 character properties in Perl
perlunicook - cookbookish examples of handling Unicode in Perl
perlebcdic - Considerations for running Perl on EBCDIC platforms
perlsec - Perl security
perlmod - Perl modules (packages and symbol tables)
perlmodlib - constructing new Perl modules and finding existing ones
perlmodstyle - Perl module style guide
perlmodinstall - Installing CPAN Modules
perlnewmod - preparing a new module for distribution
perlfilter - Source Filters
perlglossary - Perl Glossary
perlexperiment - A listing of experimental features in Perl
perldtrace - Perl's support for DTrace
CORE - Namespace for Perl's core routines
perldoc -v PerlVar可以查看Perl的变量说明:
例如输入perldoc -v $$可以看到$$的解释;
如果某些变量直接跟在-v后面识别不了,可以用双引号引起来,例如可以输入perldoc -v "$|" 查看变量$|的如下说明:
C:\>perldoc -v "$|"
HANDLE->autoflush( EXPR )
$OUTPUT_AUTOFLUSH
$| If set to nonzero, forces a flush right away and after every
write or print on the currently selected output channel. Default
is 0 (regardless of whether the channel is really buffered by
the system or not; $| tells you only whether you've asked Perl
explicitly to flush after each write). STDOUT will typically be
line buffered if output is to the terminal and block buffered
otherwise. Setting this variable is useful primarily when you
are outputting to a pipe or socket, such as when you are running
a Perl program under rsh and want to see the output as it's
happening. This has no effect on input buffering. See "getc" in
perlfunc for that. See "select" in perlfunc on how to select the
output channel. See also IO::Handle.
Mnemonic: when you want your pipes to be piping hot.
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式