名称perl - Practical Extraction and Report Language
摘要为方便翻阅, perl手册分成以下部分:
(如果你打算从头到尾通读一次, 章节顺序的安排能减少前向翻看的次数) 有关Perl模块的更多文档可以在目录/usr/local/man/下找到. 有一些是和Perl一起安装的, 也有一些第三方的模块. 用命令man(1)指定正确的目录 和启动文件即可阅读. 这些目录和文件可以用以下命令找到: 如果目录是 /usr/local/man/man1 和 /usr/local/man/man3, 只要把 /usr/local/man/man 加到 MANPATH 环境. 如果是其他目录, 就要 都加上. 如果上面说的不起作用, 也可以用附带的 perldoc 脚本阅读模块信息. 也可以考虑更换一个新版的man程序. 如果程序出现奇怪的错误, 又不知道如何查找帮助, 先试一试 -w 参数. 一般会准确的指出错误所在.
描述Perl 是一种解释型的语言, 特别适合用于扫描文本文件, 从中抽取信息, 并根据这些信息生成报告. 该语言也同样适用于很多系统维护的工作. Perl 是一种实用的(易用,高效,完整)而 非一种漂亮的(紧凑,优雅,小巧)的语言. 它结合了(作者个人看法)了C, sed, awk, sh 的 优点, 熟悉这些语言的人会觉得 Perl 很容易上手. (研究语言历史的人还可以找到 csh, Pascal, 甚至 BASIC-PLUS 的影子.) 表达式的语法和 C 十分相似. 和大多数 Unix 工具不同, Perl 不限制数据 的大小--只要有足够的存储空间, Perl 可以把整个文件的内容放进一个字符串. 递归的深度没有限制. 关联数组使用的哈希表只有在必要的时候才增长, 避免影响 性能. Perl 使用高级模式匹配技术, 能够在大量数据中快速搜索. Perl 也可以处理 二进制文本, 也可以把dbm文件当做关联数组处理. Perl 提供了数据流追踪机制避免了很多setupid的安全漏洞, Setuid 脚本比 C 程序要更安全. 如果觉得用sed 或 awk 或 sh 完成工作 有点慢, 但不想用 C 来写, Perl就可以派上用场. 也有多工具可以把 sed 和 awk 脚本翻译成 Perl 脚本.更多... Perl 第5版是一个几乎全部改写的版本, 提供了以下的改进:
环境
作者Larry Wall <<lwall@netlabs.com>, with the help of oodles of other folks.
有关文件
参看
诊断The -w switch produces some lovely diagnostics.See the perldiag manpage for explanations of all Perl's diagnostics. Compilation errors will tell you the line number of the error, with an indication of the next token or token type that was to be examined. (In the case of a script passed to Perl via -e switches, each -e is counted as one line.) Setuid scripts have additional constraints that can produce error messages such as ``Insecure dependency''. See the perlsec manpage . Did we mention that you should definitely consider using the -w switch?
BUGSThe -w switch is not mandatory.Perl is at the mercy of your machine's definitions of various operations such as type casting, atof() and sprintf() . The latter can even trigger a coredump when passed ludicrous input values. If your stdio requires a seek or eof between reads and writes on a particular stream, so does Perl. (This doesn't apply to sysread() and syswrite() .) While none of the built-in data types have any arbitrary size limits (apart from memory size), there are still a few arbitrary limits: a given identifier may not be longer than 255 characters, and no component of your PATH may be longer than 255 if you use -S . A regular expression may not compile to more than 32767 bytes internally. See the perl bugs database at http://perl.com/perl/bugs/. You may mail your bug reports (be sure to include full configuration information as output by the myconfig program in the perl source tree) to perlbug@perl.com. Perl actually stands for Pathologically Eclectic Rubbish Lister, but don't tell anyone I said that.
NOTESThe Perl motto is ``There's more than one way to do it.'' Divining how many more is left as an exercise to the reader.The three principal virtues of a programmer are Laziness, Impatience, and Hubris. See the Camel Book for why. |
电话: 0086-0577-62319278, 62319276 传真: 0086-0577-62319276
|