找回密码
 注册
查看: 7319|回复: 2

PERL编程思想 基础篇

  [复制链接]
发表于 2011-6-21 11:12:22 | 显示全部楼层 |阅读模式


第1章 PERL简介...........................................................................................................................1
1.1 使用范围............................................................................................................................1
1.2 工作原理............................................................................................................................1
1.3 执行程序............................................................................................................................2
第2章 基本概念.............................................................................................................................3
2.1 windows下安装..................................................................................................................3
2.2 Unix下安装.........................................................................................................................3
2.3 Active Perl目录介绍...........................................................................................................4
2.4 使用POD............................................................................................................................4
2.5 编辑工具............................................................................................................................5
2.5.1 EditPlus....................................................................................................................5
2.5.2 UltraEdit...................................................................................................................7
2.5.3 SciTE........................................................................................................................8
2.5.4 Open Perl IDE........................................................................................................11
2.5.5 Perl Builder............................................................................................................11
2.6 命名规范..........................................................................................................................11
2.7 变量.................................................................................................................................12
2.7.1 数字.......................................................................................................................12
2.7.2 字符串...................................................................................................................12
2.7.3 here文档.................................................................................................................14
2.7.4 日期函数...............................................................................................................15
2.7.5 数组.......................................................................................................................15
2.7.6 哈希表...................................................................................................................18
2.8 引用.................................................................................................................................19
2.9 多维数组..........................................................................................................................21
2.10 常量................................................................................................................................21
2.11 操作符............................................................................................................................22
2.11.1 赋值操作符.........................................................................................................22
2.11.2 算术操作符.........................................................................................................23
2.11.3 字符操作符.........................................................................................................23
2.11.4 比较操作符.........................................................................................................24
2.11.5 逻辑操作符.........................................................................................................24
2.11.6 位操作符.............................................................................................................24
2.11.7 组合赋值操作符.................................................................................................25
2.11.8 递增和递减操作符.............................................................................................26
2.11.9 逗号和关系操作符.............................................................................................26
2.11.10 引用操作符.......................................................................................................27
2.11.11 箭头操作符.......................................................................................................27
2.11.12 范围操作符.......................................................................................................28
2.11.13 三元操作符.......................................................................................................28
2.11.14 操作符的连接性...............................................................................................28
2.12 控制流............................................................................................................................30
2.12.1 if, else, elsif..........................................................................................................30
2.12.2 switch...................................................................................................................31
2.12.3 unless....................................................................................................................31
2.12.4 while.....................................................................................................................32
2.12.5 until......................................................................................................................33
2.12.6 for.........................................................................................................................33
2.12.7 foreach..................................................................................................................34
2.12.8 last........................................................................................................................34
2.12.9 next.......................................................................................................................35
2.12.10 redo.....................................................................................................................35
2.13 文件与目录....................................................................................................................36
2.14 例程................................................................................................................................37
2.15 执行命令........................................................................................................................39
2.16 正则表达式....................................................................................................................40
2.16.1 基本类型.............................................................................................................40
2.16.2 正则表达式模式.................................................................................................43
2.16.3 扩展使用.............................................................................................................49
2.17 格式................................................................................................................................51
2.18 POD................................................................................................................................52
2.19 模块................................................................................................................................53
2.19.1 导出.....................................................................................................................54
2.19.2 导入.....................................................................................................................54
2.19.3 程序块.................................................................................................................55
2.19.4 线程安全.............................................................................................................56
2.19.5 自动加载.............................................................................................................56
第3章 面向对象编程...................................................................................................................57
3.1 包.....................................................................................................................................57
3.2 对象.................................................................................................................................58
3.2.1 使用对象...............................................................................................................58
3.2.2 创建对象...............................................................................................................59
3.2.3 底层数据类型.......................................................................................................59
3.2.4 继承.......................................................................................................................60
3.3 tie......................................................................................................................................60
3.3.1 标量.......................................................................................................................61
3.3.2 数组.......................................................................................................................61
3.3.3 哈希表...................................................................................................................62
3.3.4 文件句柄...............................................................................................................63
3.4 设计模式..........................................................................................................................63
3.4.1 Iterator(遍历).........................................................................................................63
3.4.2 Decorator(修饰).....................................................................................................65
3.4.3 Flyweight(享元).....................................................................................................67
3.4.4 Singleton(孤子)......................................................................................................68
3.4.5 Façade(外观)..........................................................................................................70
3.4.6 Abstract Factory(抽象工厂)...................................................................................71
第4章 常用模块...........................................................................................................................74
4.1 手动安装模块..................................................................................................................74
4.1.1 Makefile.................................................................................................................74
4.1.2 Makefile.PL............................................................................................................77
4.1.3 在Unix下安装.......................................................................................................79
4.1.4 CPAN安装.............................................................................................................80
4.1.5 ppm安装.................................................................................................................80
4.1.6 构建模块...............................................................................................................82
4.1.7 制作PPM安装包...................................................................................................83
4.1.8 查找已安装模块...................................................................................................84
4.2 文件.................................................................................................................................85
4.2.1 IO::Handle对象......................................................................................................85
4.2.2 IO::Seekable...........................................................................................................91
4.2.3 IO::File...................................................................................................................92
4.2.4 文件测试...............................................................................................................94
4.2.5 glob........................................................................................................................97
4.2.6 管道操作...............................................................................................................99
4.3 目录.................................................................................................................................99
4.4 数据结构........................................................................................................................101
4.4.1 Data:umper.......................................................................................................101
4.5 命令行............................................................................................................................101
4.5.1 命令行约定.........................................................................................................101
4.5.2 单字符选项约定处理.........................................................................................101
4.5.3 长选项约定处理.................................................................................................103
4.6 配置................................................................................................................................107
4.6.1 AppConfig............................................................................................................107
4.7 XML...............................................................................................................................117
4.7.1 XML::Simple.......................................................................................................118
4.7.2 XML:arser:erlSAX........................................................................................122
4.7.3 XML::UM............................................................................................................124
4.8 时间................................................................................................................................126
4.8.1 Date::Manip.........................................................................................................126
4.8.2 HTTP:ate..........................................................................................................131
4.8.3 Date::Simple.........................................................................................................133
4.9 日志................................................................................................................................136
4.9.1 Log:ogLite........................................................................................................136
4.9.2 Log:og4perl......................................................................................................137
4.10 中文与unicode.............................................................................................................141
4.10.1 Unicode::Map.....................................................................................................141
4.10.2 Unicode::String..................................................................................................141
4.10.3 encoding.............................................................................................................143
4.10.4 Lingua::ZH::TaBE..............................................................................................143
4.11 解析文本......................................................................................................................144
4.11.1 Parse::RecDescent..............................................................................................144
4.12 网络..............................................................................................................................157
4.12.1 Net::FTP.............................................................................................................157
4.12.2 Net::Telnet..........................................................................................................162
4.12.3 WebService.........................................................................................................163
4.13 提取网页......................................................................................................................163
4.13.1 HTTP::Request...................................................................................................163
第5章 数据库DBI......................................................................................................................168
5.1 概述................................................................................................................................168
5.2 调试................................................................................................................................172
5.3 DBI代理DBD:roxy......................................................................................................173
5.4 DBD::AnyData................................................................................................................173
5.5 Tie:BI..........................................................................................................................175
5.6 MS SqlServer..................................................................................................................176
5.6.1 WIN32:ODBC......................................................................................................176
5.6.2 Win32::ADO........................................................................................................178
5.6.3 DBD::ODBC........................................................................................................179
5.7 Oracle数据库..................................................................................................................181
5.7.1 DBD::Oracle........................................................................................................181
5.7.2 Oracle::OCI..........................................................................................................186
5.8 Sybase数据库.................................................................................................................187
5.8.1 DBD-Sybase.........................................................................................................188
5.9 PostgreSQL数据库.........................................................................................................192
5.9.1 PL/perl..................................................................................................................192
5.10 MySQL.........................................................................................................................194
5.10.1 DBD::mysql.......................................................................................................194
5.11 ODBC...........................................................................................................................201
5.11.1 iODBC................................................................................................................201
第6章 调试................................................................................................................................204
6.1 单元测试........................................................................................................................204
6.1.1 Test::Simple与Test::More....................................................................................205
6.1.2 Test::Unit..............................................................................................................214
6.2 异常处理........................................................................................................................214
6.2.1 定义.....................................................................................................................214
6.2.2 使用面向对象异常处理的好处.........................................................................215
6.2.3 在Perl中实现......................................................................................................217
6.2.4 eval的问题...........................................................................................................218
6.2.5 使用Error.pm......................................................................................................219
6.2.6 结论.....................................................................................................................225
第7章 Perl扩展..........................................................................................................................226
7.1 制作可执行文件............................................................................................................226
7.1.1 使用perlcc制作exe.............................................................................................226
7.2 从c调用perl....................................................................................................................226
7.2.1 准备工作.............................................................................................................226
7.2.2 添加Perl解释器..................................................................................................227
7.3 使用Perlscript................................................................................................................227
7.3.1 从PerlScript访问ASP内在对象..........................................................................228
7.3.2 其它的选择.........................................................................................................230
7.4 其它语言中使用Perl.....................................................................................................232
7.5 Perl中使用c....................................................................................................................233
7.5.1 Inline....................................................................................................................233
7.5.2 H2xs.....................................................................................................................238
第8章 Unicode与中文...............................................................................................................242
8.1 字符集............................................................................................................................242
8.2 中文................................................................................................................................242
8.2.1 编码.....................................................................................................................242
8.3 XML与中文....................................................................................................................243
8.3.1 Expat....................................................................................................................244
第9章 Perl6简介.......................................................................................................................246
9.1 Perl6体系结构...............................................................................................................246
9.2 Parrot..............................................................................................................................248
9.3 Perl6语法.......................................................................................................................248
9.3.1 函数.....................................................................................................................248
9.3.2 对象.....................................................................................................................249
附录A 命令行参数....................................................................................................................251
附录B 环境变量........................................................................................................................255
附录C 特殊变量........................................................................................................................256
附录D 预编译指令......................................................................................................................264
参考资源......................................................................................................................................265
9.4 书籍................................................................................................................................265
9.5 网址................................................................................................................................265
Perl编程思想(基础篇).pdf (1.21 MB, 下载次数: 36, 售价: 1 金钱)
回复

使用道具 举报

发表于 2011-10-31 11:07:58 | 显示全部楼层
Think in perl——Perl编程思想,是一样的 浪费金钱
回复 支持 反对

使用道具 举报

发表于 2012-1-11 18:00:40 | 显示全部楼层
...............
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2024-11-21 14:42 , Processed in 0.043236 second(s), 19 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表