1 / 71
文档名称:

【工具辅导类】The PERL Programming Language.pdf

格式:pdf   页数:71页
下载后只包含 1 个 PDF 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

【工具辅导类】The PERL Programming Language.pdf

上传人:中国课件站 2011/7/20 文件大小:0 KB

下载得到文件列表

【工具辅导类】The PERL Programming Language.pdf

文档介绍

文档介绍:The PERL Programming Language
Larry Wall
<>
ABSTRACT
The Practical Extraction and Report Language (perl) is an interpreted language
optimized for scanning arbitrary text files, extracting information from those text files,
and printing reports based on that information. It is also a good language for many sys-
tem management tasks. The language is intended to be practical (easy to use, efficient,
complete) rather than beautiful (tiny, elegant, minimal). bines (in the author’s
opinion, anyway) some of the best features of C, sed, awk, and sh, so people familiar with
those languages should have little difficulty with it. (Language historians will also note
some vestiges of csh, Pascal, and even BASIC-PLUS.) Expression syntax corresponds
quite closely to C expression syntax. Unlike most Unix utilities, perl does not arbitrarily
limit the size of your data— if you’ve got the memory, perl can slurp in your whole file
as a single string. Recursion is of unlimited depth. And the hash tables used by associa-
tive arrays grow as necessary to prevent degraded performance. Perl uses sophisticated
pattern matching techniques to scan large amounts of data very quickly. Although opti-
mized for scanning text, perl can also deal with binary data, and can make dbm files look
like associative arrays (where dbm is available). Setuid perl scripts are safer than C pro-
grams through a dataflow tracing mechanism which prevents many stupid security holes.
If you have a problem that would ordinarily use sed or awk or sh, but it exceeds their
capabilities or must run a little faster, and you don’t want to write the silly thing in C,
then perl may be for you. There are also translators to turn your sed and awk scripts
into perl scripts.
1. Data Types and Objects
Perl has three data types: scalars, arrays of scalars, and associative arrays of scalars. Normal arrays
are indexed by number, and associative arrays by string.
The interpretation of oper