perl 中文man页面

系统
Perl是一种计算机语言,它针对以下动作做了优化: 扫描任意文本文件 ,从文本文件中提取信息,并提交基于这些信息的 报告.它也是非常适合于系统管理任务的语言.本语言以实用(易用,高效,完整)为出发点,略欠优美(小巧,文雅,精炼).

NAME[名称]

perl - Practical Extraction and Report Language(实 用 摘 录 和 报 告 语 言 )

SYNOPSIS[总览]

 

 

[ -sTuU ]
[ -hv ] [ -V[:configvar] ]
[ -cw ] [ -d[:debugger] ] [ -D[number/list] ]
[ -pna ] [ -Fpattern ] [ -l[octal] ] [ -0[octal] ]
[ -Idir ] [ -m[-]module ] [ -M[-]'module...' ]
[ -P ]
[ -S ]
[ -x[dir] ]
[ -i[extension] ]
[ -e 'command' ] [ -- ] [ programfile ] [ argument ]...
 

为 方 便 阅 读 , Perl 手 册 被 分 为 如 下 的 一 些 小 节 :

perl Perl 概 述 (本 小 节 )
perldelta Perl 自 前 一 版 所 作 的 修 改 
perl5004delta Perl 5.004版 中 所 作 的 修 改 
perlfaq Perl 常 见 问 题 集 (faqs)
perltoc Perl 相 关 文 件 目 录 表 
perldata Perl 数 据 结 构 
perlsyn Perl 语 法 
perlop Perl 操 作 符 和 优 先 级 
perlre Perl 正则表达式(也有把它叫成"正规表达式"的 )
perlrun Perl 命 令 解 释 器 的 执 行 及 其 选 项 
perlfunc Perl 固 有 (内 部 )函 数 
perlopentut Perl open() 教 程 
perlvar Perl 预 定 义 的 变 量 
perlsub Perl 子 函 数 
perlmod Perl 模 块 : 它 们 的 工 作 原 理 
perlmodlib Perl 模 块 : 如 何 写 出 和 使 用 自 己 的 模 块 
perlmodinstall Perl 模 块 : 如 何 从 CPAN 来 安 装 模 块 
perlform Perl 格 式 化 
perllocale Perl 本 地 支 持 
perlref Perl 引 用 
perlreftut Perl 引 用 的 简 要 介 绍 
perldsc Perl 数 据 结 构 介 绍 
perllol Perl 数据结构: 列表的列表(或叫做:数组的数组)
perltoot Perl OO tutorial
perlobj Perl 对 象 
perltie Perl objects hidden behind simple variables
perlbot Perl OO 窍 门 和 例 子 
perlipc Perl 进 程 间 通 讯 
perlthrtut Perl 进 程 的 教 程 
perldebug Perl 调 试 
perldiag Perl 调 试 (诊 断 )信 息 
perlsec Perl 安 全 
perltrap Perl traps for the unwary
perlport Perl 移 植 指 南 
perlstyle Perl 风 格 指 南 (提 高 程 序 的 易 读 性 )
perlpod Perl plain old documentation(简 单 格 式 文 本 )
perlbook Perl 书 籍 信 息 
perlembed Perl 嵌 入 C 或 C++ 程 序 的 方 法 
perlapio Perl internal IO abstraction interface
perlxs Perl XS 程 序 编 程 接 口 
perlxstut Perl XS 教 程 
perlguts Perl internal functions for those doing extensions
(用 于 实 现 扩 充 的 内 部 函 数 )
perlcall Perl calling conventions from C
(在 c 程 序 中 调 用 perl 的 约 定 )
perlhist Perl 历 史 记 录 

(如 果 您 打 算 通 读 所 有 文 献 的 话 ,按 照 上 面 所 列 的 顺 序 阅 读 可 以 节 省 一 些 时 间 .)

缺 省 情 况 下 , 上 述 所 有 手 册 页 安 装 在 /usr/local/man/ 目 录 下 .

Perl 模 块 还 有 一 些 附 加 的 文 档 , 缺 省 情 况 下 ,安 装 在 /usr/local/lib/perl5/man 目 录 下 (或 者 在 Perl 库 目 录 (lib)的 man 子 目 录 下 ). 有 些 附 加 文 档 是 Perl 自 带 的 ,还 有 些 是 第 三 方 模 块 附 带 的 .

如 果 路 径 设 置 正 确 的 话 ,您 应 该 可 以 用 man(1) 来 察 看 Perl 的 文 档 了 .要 找 到 手 册 页 的 安 装 路 径 ,使 用 如 下 命 令 :

perl -V:man.dir

如 果 路 径 有 共 同 的 主 干 , 比 如 /usr/local/man/man1/usr/local/man/man3, 您 只 需 要 把 主 干(/usr/local/man) 添 加 到 您 的 man(1) 配 置 文 件 中 或 是 环 境 变 量 MANPATH 中 . 如 果 它 们 的 主 干 不 同 ,那 您 就 要 把 它 们 都 加 进 去 .

如 果 还 不 行 , 您 还 可 以 使 用 perldoc 脚 本 来 察 看 模 块 信 息 . 或 者 把 man 重 装 一 下 .

如 果 您 的 程 序 出 现 了 很 奇 怪 的 错 误 ,而 且 您 也 不 知 道 应 察 看 哪 方 面 的 帮 助 ,则 您 可 以 试 试 -w 参 数 . 它 通 常 能 够 发 现 问 题 出 在 哪 儿 .

DESCRIPTION[描述]

Perl 是 一 种 计 算 机 语 言 ,它 针 对 以 下 动 作 做 了 优 化 : 扫 描 任 意 文 本 文 件 ,从 文 本 文 件 中 提 取 信 息 ,并 提 交 基 于 这 些 信 息 的 报 告 . 它 也 是 非 常 适 合 于 系 统 管 理 任 务 的 语 言 . 本 语 言 以 实 用 (易 用 ,高 效 ,完 整 )为 出 发 点 ,略 欠 优 美 (小 巧 ,文 雅 ,精 炼 ).

Perl 结 合 了 (至 少 作 者 是 这 么 希 望 的 ) C, sed, awk, 和 sh 的 一 些 最 好 的 特 性 , 所 以 熟 悉 这 些 语 言 的 读 者 应 该 不 会 感 到 太 困 难 .(语 言 学 家 们 或 许 还 会 发 现 一 些 csh, Pascal, 甚 至 BASIC-PLUS 的 痕 迹 .) 表 达 式 语 法 与 C 的 语 法 极 为 相 近 . 与 大 多 数 Unix 实 用 程 序 不 同 , Perl 不 限 制 您 的 数 据 的 大 小 ---只 要 您 的 内 存 足 够 大 ,您 可 以 写 入 任 意 大 小 的 数 据 . 如 果 您 的 内 存 足 够 大 , Perl 可 以 把 您 的 整 个 文 件 放 在 一 个 字 符 串 中 . 递 归 没 有 深 度 限 制 . 并 且 哈 希 表 (有 时 叫 做 "关 联 数 组 ")个 以 根 据 需 要 膨 胀 . Perl 能 够 对 大 批 量 的 数 据 进 行 快 速 的 模 式 匹 配 . 虽 然 是 对 文 本 扫 描 进 行 了 优 化 , 但 是 Perl 仍 然 能 够 处 理 二 进 制 数 据 , 并 且 可 以 使 dbm 文 件 看 起 来 象 是 哈 希 表 . Setuid Perl scripts are safer than C programs through a dataflow tracing mechanism which prevents many stupid security holes.(这 句 翻 不 准 , 总 之 是 : 安 全 性 能 较 C 为 强 ).

如 果 您 本 来 想 用 sedawksh 写 个 程 序 ,但 是 它 们 的 功 能 不 够 ,或 者 是 您 想 运 行 的 快 一 些 ,但 是 又 不 想 用 C 干 这 样 的 小 事 ,那 Perl 就 最 适 合 您 了 . 有 些 程 序 可 以 把 您 的 sedawk 脚 本 翻 译 成 Perl 脚 本 .

不 过 这 可 不 是 全 部 , 还 有 更 多 的 内 容 ...

Perl 第 5 版 几 乎 是 完 全 重 写 了 , 它 提 供 如 下 增 加 的 特 性 :
* Many usability enhancements(大 量 增 强 特 性 ) 现 在 可 以 写 更 多 的 Perl 代 码 (甚 至 在 正 则 表 达 式 内 部 也 可 以 ). 前 方 定 义 的 含 糊 不 清 的 变 量 可 以 在 后 面 用 别 的 内 存 标 识 符 取 代 (Formerly cryptic variable names can be replaced by mnemonic identifiers). 错 误 信 息 提 供 了 更 多 的 有 用 信 息 , 可 选 的 警 告 信 息 可 以 发 现 新 手 常 犯 的 大 多 数 错 误 . 这 里 只 能 择 要 说 之 ,更 多 的 特 性 等 您 去 发 现 . 如 果 您 得 到 奇 怪 的 信 息 ,可 以 试 着 使 用 -w 参 数 !!! 如 果 您 未 得 到 奇 怪 的 信 息 ,也 请 试 一 试 -w 参 数 .
* Simplified grammar(简 单 的 文 法 ) 新 的 编 译 文 法 是 原 来 的 一 半 大 小 . 很 多 随 意 的 文 法 得 到 了 规 范 . 保 留 字 减 掉 了 2/3. 尽 管 如 此 ,几 乎 所 有 原 来 的 Perl 脚 本 都 可 以 不 做 改 变 而 正 常 运 行 .
* Lexical scoping(词 汇 作 用 域 ) Perl 变 量 现 在 可 以 定 义 在 词 汇 作 用 域 内 , 就 象 C 中 的 "auto" 变 量 . 这 不 仅 更 高 效 ,而 且 也 有 利 于 "编 写 大 的 程 序 ". Anonymous subroutines exhibit deep binding of lexical variables (closures). (这 句 不 会 )
* Arbitrarily nested data structures(任 意 嵌 套 数 据 结 构 ) 任 何 标 量 值 , 包 括 数 组 元 素 , 现 在 都 可 以 包 含 对 其 它 变 量 或 是 子 程 序 的 引 用 . 您 可 以 轻 松 的 创 建 匿 名 变 量 和 子 程 序 . Perl 为 您 管 理 您 的 引 用 .
* Modularity and reusability(模 块 性 和 可 重 用 性 ) The Perl library is now defined in terms of modules which can be easily shared among various packages. A package may choose to import all or a portion of a module's published interface. Pragmas (that is, compiler directives) are defined and used by the same mechanism.
* Object-oriented programming(面 向 对 象 编 程 ) 包 就 象 是 类 . 动 态 多 重 继 承 和 虚 拟 函 数 已 经 得 到 支 持 ,并 且 没 有 太 多 的 新 语 法 . 文 件 句 柄 可 以 作 为 对 象 来 创 建 .
* Embeddable and Extensible(嵌 入 和 扩 充 ) Perl 现 在 可 以 容 易 的 嵌 入 到 您 的 C 或 C++ 程 序 中 , 可 以 通 过 文 字 界 面 调 用 其 它 子 程 序 或 者 被 调 用 . XS 预 处 理 程 序 用 于 将 您 的 C 或 C++ 子 程 序 加 入 到 Perl. 现 在 支 持 动 态 模 块 调 用 , Perl 本 身 就 可 以 做 成 一 个 动 态 库 .
* POSIX compliant(posix 兼 容 ) 一 个 主 要 的 新 模 块 就 是 POSIX 模 块 , 提 供 了 对 所 有 POSIX 子 程 序 和 定 义 的 存 取 功 能 , via object classes where appropriate.
* Package constructors and destructors(包 构 造 器 和 析 构 器 ) The new BEGIN and END blocks provide means to capture control as a package is being compiled, and after the program exits. As a degenerate case they work just like awk's BEGIN and END when you use the -p or -n switches.
* Multiple simultaneous DBM implementations(同 时 执 行 多 个 DBM) A Perl program may now access DBM, NDBM, SDBM, GDBM, and Berkeley DB files from the same script simultaneously. In fact, the old dbmopen interface has been generalized to allow any variable to be tied to an object class which defines its access methods.
* Subroutine definitions may now be autoloaded(子 程 序 定 义 可 自 动 装 载 ) In fact, the AUTOLOAD mechanism also allows you to define any arbitrary semantics for undefined subroutine calls. It's not for just autoloading.
* Regular expression enhancements(正 则 表 达 式 增 强 ) You can now specify nongreedy quantifiers. You can now do grouping without creating a backreference. You can now write regular expressions with embedded whitespace and comments for readability. A consistent extensibility mechanism has been added that is upwardly compatible with all old regular expressions.
* Innumerable Unbundled Modules(数 不 清 的 分 类 模 块 ) The Comprehensive Perl Archive Network described in the perlmodlib manpage contains hundreds of plug-and-play modules full of reusable code. See http://www.perl.com/CPAN for a site near you.
* Compilability(编 译 能 力 ) 还 没 有 完 全 做 好 ,不 过 perl-to-C 编 译 器 已 经 可 以 工 作 了 . 可 以 产 生 可 移 植 的 字 节 代 码 , C 或 是 优 化 的 C 代 码 .

好 啦 ,广 告 做 完 了 .

AVAILABILITY[实用性]

Perl 适 用 于 大 多 数 主 流 操 作 系 统 平 台 , 包 括 大 部 分 类 -Unix 平 台 . 下 面 是 截 至 1999年 2月 可 以 运 行 Perl 5.005_03 的 平 台 .

下 列 平 台 可 以 使 用 如 下 网 站 提 供 的 标 准 源 代 码 建 立 Perl http://www.perl.com/CPAN/src/index.html

AIX Linux SCO ODT/OSR
A/UX MachTen Solaris
BeOS MPE/iX SunOS
BSD/OS NetBSD SVR4
DG/UX NextSTEP Tru64 UNIX 3)
DomainOS OpenBSD Ultrix
DOS DJGPP 1) OpenSTEP UNICOS
DYNIX/ptx OS/2 VMS
FreeBSD OS390 2) VOS
HP-UX PowerMAX Windows 3.1 1)
Hurd QNX Windows 95 1) 4)
IRIX Windows 98 1) 4)
Windows NT 1) 4)
1) DOS 模 式 下 DOS 或 OS/2 端 口 都 可 用 
(in DOS mode DOS or OS/2 ports can be used)
2) 原 来 是 MVS
3) 原 来 是 Digital UNIX ,更 早 前 是 DEC OSF/1
4) 编 译 器 : Borland, Cygwin32, Mingw32 EGCS/GCC, VC++

以 下 平 台 可 以 建 立 Perl ,但 是 未 对 5.005_03 进 行 测 试 , 原 因 是 这 些 硬 /软 件 比 较 稀 少 ,或 是 我 们 没 有 使 用 这 些 平 台 的 人 员 ,或 是 二 者 兼 有 .


3b1 FPS Plan 9 .br AmigaOS GENIX PowerUX .br ConvexOS Greenhills RISC/os .br CX/UX ISC Stellar .br DC/OSx MachTen 68k SVR2 .br DDE SMES MiNT TI1500 .br DOS EMX MPC TitanOS .br Dynix NEWS-OS UNICOS/mk .br EP/IX Opus Unisys Dynix .br ESIX Unixware
 

下 列 平 台 预 计 在 5.006 版 可 以 支 持 ,但 是 5.005_03 还 不 行 :

BS2000
Netware
Rhapsody
VM/ESA

下 列 平 台 有 特 定 的 源 代 码 和 二 进 制 程 序 ,可 从 http://www.perl.com/CPAN/ports/index.html. 得 到

Perl release
AS/400 5.003
MacOS 5.004
Netware 5.003_07
Tandem Guardian 5.004

下 列 平 台 只 有 可 用 的 二 进 制 程 序 ,可 从 http://www.perl.com/CPAN/ports/index.html. 得 到

Perl release
Acorn RISCOS 5.005_02
AOS 5.002
LynxOS 5.004_02

ENVIRONMENT[环境]

参 考 perlrun 手 册 页 .

AUTHOR[作者]

Larry Wall <larry@wall.org>, 以 及 很 多 人 的 帮 助 .

如 果 您 的 成 功 故 事 或 是 某 些 例 证 有 助 于 增 加 其 他 人 使 用 Perl 的 兴 趣 或 信 心 ,或 是 您 想 表 示 对 Larry 和 其 它 开 发 者 的 感 谢 , 您 可 以 写 信 到 <perl-thanks@perl.org>.

FILES[相关文件]

"@INC" perl 库 文 件 的 位 置 

SEE ALSO[另见]

a2p awk 到 perl 翻 译 器 
s2p sed 到 perl 翻 译 器 

#p#

NAME

perl - Practical Extraction and Report Language

SYNOPSIS

perl  -sTuU ] [ -hv ] [ -V[:configvar] ]

    [ -cw ] [ -d[:debugger] ] [ -D[number/list] ]
    [ -pna ] [ -Fpattern ] [ -l[octal] ] [ -0[octal] ]
    [ -Idir ] [ -m[-]module ] [ -M[-]'module...' ]
    [ -P ] [ -S ] [ -x[dir] ]
    [ -i[extension] ] [ -e 'command' ] [ -- ] [ programfile ] [ argument ]...

If you're new to Perl, you should start with perlintro, which is a general intro for beginners and provides some background to help you navigate the rest of Perl's extensive documentation.

For ease of access, the Perl manual has been split up into several sections.

Overview

    perl                Perl overview (this section)
    perlintro           Perl introduction for beginners
    perltoc             Perl documentation table of contents

Tutorials

    perlreftut          Perl references short introduction
    perldsc             Perl data structures intro
    perllol             Perl data structures: arrays of arrays

    perlrequick         Perl regular expressions quick start
    perlretut           Perl regular expressions tutorial

    perlboot            Perl OO tutorial for beginners
    perltoot            Perl OO tutorial, part 1
    perltooc            Perl OO tutorial, part 2
    perlbot             Perl OO tricks and examples

    perlstyle           Perl style guide

    perlcheat           Perl cheat sheet
    perltrap            Perl traps for the unwary
    perldebtut          Perl debugging tutorial

    perlfaq             Perl frequently asked questions
      perlfaq1          General Questions About Perl
      perlfaq2          Obtaining and Learning about Perl
      perlfaq3          Programming Tools
      perlfaq4          Data Manipulation
      perlfaq5          Files and Formats
      perlfaq6          Regexes
      perlfaq7          Perl Language Issues
      perlfaq8          System Interaction
      perlfaq9          Networking

Reference Manual

    perlsyn             Perl syntax
    perldata            Perl data structures
    perlop              Perl operators and precedence
    perlsub             Perl subroutines
    perlfunc            Perl built-in functions
      perlopentut       Perl open() tutorial
      perlpacktut       Perl pack() and unpack() tutorial
    perlpod             Perl plain old documentation
    perlpodspec         Perl plain old documentation format specification
    perlrun             Perl execution and options
    perldiag            Perl diagnostic messages
    perllexwarn         Perl warnings and their control
    perldebug           Perl debugging
    perlvar             Perl predefined variables
    perlre              Perl regular expressions, the rest of the story
    perlreref           Perl regular expressions quick reference
    perlref             Perl references, the rest of the story
    perlform            Perl formats
    perlobj             Perl objects
    perltie             Perl objects hidden behind simple variables
      perldbmfilter     Perl DBM filters

    perlipc             Perl interprocess communication
    perlfork            Perl fork() information
    perlnumber          Perl number semantics

    perlthrtut          Perl threads tutorial
      perlothrtut       Old Perl threads tutorial

    perlport            Perl portability guide
    perllocale          Perl locale support
    perluniintro        Perl Unicode introduction
    perlunicode         Perl Unicode support
    perlebcdic          Considerations for running Perl on EBCDIC platforms

    perlsec             Perl security

    perlmod             Perl modules: how they work
    perlmodlib          Perl modules: how to write and use
    perlmodstyle        Perl modules: how to write modules with style
    perlmodinstall      Perl modules: how to install from CPAN
    perlnewmod          Perl modules: preparing a new module for distribution

    perlutil            utilities packaged with the Perl distribution

    perlcompile         Perl compiler suite intro

    perlfilter          Perl source filters

Internals and C Language Interface

    perlembed           Perl ways to embed perl in your C or C++ application
    perldebguts         Perl debugging guts and tips
    perlxstut           Perl XS tutorial
    perlxs              Perl XS application programming interface
    perlclib            Internal replacements for standard C library functions
    perlguts            Perl internal functions for those doing extensions
    perlcall            Perl calling conventions from C

    perlapi             Perl API listing (autogenerated)
    perlintern          Perl internal functions (autogenerated)
    perliol             C API for Perl's implementation of IO in Layers
    perlapio            Perl internal IO abstraction interface

    perlhack            Perl hackers guide

Miscellaneous

    perlbook            Perl book information
    perltodo            Perl things to do

    perldoc             Look up Perl documentation in Pod format

    perlhist            Perl history records
    perldelta           Perl changes since previous version
    perl584delta        Perl changes in version 5.8.4
    perl583delta        Perl changes in version 5.8.3
    perl582delta        Perl changes in version 5.8.2
    perl581delta        Perl changes in version 5.8.1
    perl58delta         Perl changes in version 5.8.0
    perl573delta        Perl changes in version 5.7.3
    perl572delta        Perl changes in version 5.7.2
    perl571delta        Perl changes in version 5.7.1
    perl570delta        Perl changes in version 5.7.0
    perl561delta        Perl changes in version 5.6.1
    perl56delta         Perl changes in version 5.6
    perl5005delta       Perl changes in version 5.005
    perl5004delta       Perl changes in version 5.004

    perlartistic        Perl Artistic License
    perlgpl             GNU General Public License

Language-Specific

    perlcn              Perl for Simplified Chinese (in EUC-CN)
    perljp              Perl for Japanese (in EUC-JP)
    perlko              Perl for Korean (in EUC-KR)
    perltw              Perl for Traditional Chinese (in Big5)

Platform-Specific

    perlaix             Perl notes for AIX
    perlamiga           Perl notes for AmigaOS
    perlapollo          Perl notes for Apollo DomainOS
    perlbeos            Perl notes for BeOS
    perlbs2000          Perl notes for POSIX-BC BS2000
    perlce              Perl notes for WinCE
    perlcygwin          Perl notes for Cygwin
    perldgux            Perl notes for DG/UX
    perldos             Perl notes for DOS
    perlepoc            Perl notes for EPOC
    perlfreebsd         Perl notes for FreeBSD
    perlhpux            Perl notes for HP-UX
    perlhurd            Perl notes for Hurd
    perlirix            Perl notes for Irix
    perlmachten         Perl notes for Power MachTen
    perlmacos           Perl notes for Mac OS (Classic)
    perlmacosx          Perl notes for Mac OS X
    perlmint            Perl notes for MiNT
    perlmpeix           Perl notes for MPE/iX
    perlnetware         Perl notes for NetWare
    perlos2             Perl notes for OS/2
    perlos390           Perl notes for OS/390
    perlos400           Perl notes for OS/400
    perlplan9           Perl notes for Plan 9
    perlqnx             Perl notes for QNX
    perlsolaris         Perl notes for Solaris
    perltru64           Perl notes for Tru64
    perluts             Perl notes for UTS
    perlvmesa           Perl notes for VM/ESA
    perlvms             Perl notes for VMS
    perlvos             Perl notes for Stratus VOS
    perlwin32           Perl notes for Windows

By default, the manpages listed above are installed in the /usr/local/man/ directory.

Extensive additional documentation for Perl modules is available. The default configuration for perl will place this additional documentation in the /usr/local/lib/perl5/man directory (or else in the man subdirectory of the Perl library directory). Some of this additional documentation is distributed standard with Perl, but you'll also find documentation for third-party modules there.

You should be able to view Perl's documentation with your man(1) program by including the proper directories in the appropriate start-up files, or in the MANPATH environment variable. To find out where the configuration has installed the manpages, type:

    perl -V:man.dir

If the directories have a common stem, such as /usr/local/man/man1 and /usr/local/man/man3, you need only to add that stem (/usr/local/man) to your man(1) configuration files or your MANPATH environment variable. If they do not share a stem, you'll have to add both stems.

If that doesn't work for some reason, you can still use the supplied perldoc script to view module information. You might also look into getting a replacement man program.

If something strange has gone wrong with your program and you're not sure where you should look for help, try the -w switch first. It will often point out exactly where the trouble is.

DESCRIPTION

Perl is a language optimized for scanning arbitrary text files, extracting information from those text files, and printing reports based on that information. It's also a good language for many system management tasks. The language is intended to be practical (easy to use, efficient, complete) rather than beautiful (tiny, elegant, minimal).

Perl combines (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 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 tables used by hashes (sometimes called ``associative arrays'') grow as necessary to prevent degraded performance. Perl can use sophisticated pattern matching techniques to scan large amounts of data quickly. Although optimized for scanning text, Perl can also deal with binary data, and can make dbm files look like hashes. Setuid Perl scripts are safer than C programs through a dataflow tracing mechanism that 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.

But wait, there's more...

Begun in 1993 (see perlhist), Perl version 5 is nearly a complete rewrite that provides the following additional benefits:

*
modularity and reusability using innumerable modules

Described in perlmod, perlmodlib, and perlmodinstall.

*
embeddable and extensible

Described in perlembed, perlxstut, perlxs, perlcall, perlguts, and xsubpp.

*
roll-your-own magic variables (including multiple simultaneous DBM implementations)

Described in perltie and AnyDBM_File.

*
subroutines can now be overridden, autoloaded, and prototyped

Described in perlsub.

*
arbitrarily nested data structures and anonymous functions

Described in perlreftut, perlref, perldsc, and perllol.

*
object-oriented programming

Described in perlobj, perlboot, perltoot, perltooc, and perlbot.

*
support for light-weight processes (threads)

Described in perlthrtut and threads.

*
support for Unicode, internationalization, and localization

Described in perluniintro, perllocale and Locale::Maketext.

*
lexical scoping

Described in perlsub.

*
regular expression enhancements

Described in perlre, with additional examples in perlop.

*
enhanced debugger and interactive Perl environment, with integrated editor support

Described in perldebtut, perldebug and perldebguts.

*
POSIX 1003.1 compliant library

Described in POSIX.

Okay, that's definitely enough hype.

AVAILABILITY

Perl is available for most operating systems, including virtually all Unix-like platforms. See ``Supported Platforms'' in perlport for a listing.

ENVIRONMENT

See perlrun.

AUTHOR

Larry Wall <larry@wall.org>, with the help of oodles of other folks.

If your Perl success stories and testimonials may be of help to others who wish to advocate the use of Perl in their applications, or if you wish to simply express your gratitude to Larry and the Perl developers, please write to perl-thanks@perl.org .

FILES

 "@INC"                 locations of perl libraries

SEE ALSO

 a2p    awk to perl translator
 s2p    sed to perl translator

 

perl

责任编辑:韩亚珊 来源: CMPP.net
相关推荐

2011-08-24 16:48:36

man中文man

2011-08-15 10:21:09

man中文man

2011-08-11 16:11:49

at中文man

2011-08-25 10:21:56

man.conf中文man

2011-11-01 13:46:50

中文mantac

2011-08-25 16:55:26

gets中文man

2011-08-25 15:49:02

freopen中文man

2011-08-25 16:00:56

fflush中文man

2011-08-25 16:08:55

fsetpos中文man

2011-08-25 15:33:18

exit中文man

2011-08-24 17:19:00

raw中文man

2011-08-25 10:55:37

services中文man

2011-08-25 09:35:26

units中文man

2011-08-24 13:57:35

DECLARE中文man

2011-08-11 15:28:43

ali中文man

2011-08-23 17:18:44

umount中文man

2011-08-23 17:24:11

userdel中文man

2011-08-23 17:33:22

rdev中文man

2011-08-23 18:05:21

ABORT中文man

2011-08-18 19:15:25

group中文man
点赞
收藏

51CTO技术栈公众号