精通Perl 第2版PDF电子书下载
- 电子书积分:13 积分如何计算积分?
- 作 者:(美)福瓦著
- 出 版 社:南京:东南大学出版社
- 出版年份:2014
- ISBN:9787564150020
- 页数:377 页
1.Advanced Regular Expressions 1
Readable Regexes,/x and(?#…) 1
Global Matching 3
Global Match Anchors 5
Recursive Regular Expressions 7
Repeating a Subpattern 7
Lookarounds 18
Lookahead Assertions,(?=PATTERN)and(?!PATTERN) 18
Lookbehind Assertions,(?<!PATTERN)and(?<=PATTERN) 22
Debugging Regular Expressions 25
The-D Switch 25
Summary 29
Further Reading 29
2.Secure Programming Techniques 31
Bad Data Can Ruin Your Day 31
Taint Checking 32
Warnings Instead of Fatal Errors 34
Automatic Taint Mode 35
mod_perl 35
Tainted Data 35
Side Effects of Taint Checking 36
Untainting Data 37
IO::Handle::untaint 39
Hash Keys 40
Taint::Util 41
Choosing Untainted Data with Tainted Data 41
Symbolic References 42
Defensive Database Programming with DBI 45
List Forms of system and exec 47
Three-Argument open 48
sysopen 49
Limit Special Privileges 49
Safe Compartments 50
Safe Limitations 56
A Little Fun 56
Summary 57
Further Reading 58
3.Perl Debuggers 61
Before You Waste Too Much Time 61
The Best Debugger in the World 62
Safely Changing Modules 63
Wrapping Subroutines 64
The Perl Debugger 67
Alternative Debuggers 68
Using a Different Debugger with-d 68
Devel::ptkdb 68
Devel::ebug 70
Devel::hdb 71
IDE Debuggers 72
EPIC 72
Komodo 72
Summary 72
Further Reading 73
4.Profiling Perl 75
Finding the Culprit 75
The General Approach 79
Profiling DBI 81
Other DBI::Profile Reports 85
Making It Even Easier 86
Switching Databases 87
Devel::NYTProf 89
Writing My Own Profiler 90
Devel::Line Counter 90
Profiling Test Suites 91
Devel::Cover 91
Summary 93
Further Reading 93
5.Benchmarking Perl 95
Benchmarking Theory 95
Benchmarking Time 97
Comparing Code 100
Don't Turn Off Your Thinking Cap 103
Isolating the Environment 107
Handling Outliers 109
Memory Use 111
The perlbench Tool 116
Summary 118
Further Reading 118
6.Cleaning Up Perl 121
Good Style 121
perltidy 122
Deobfuscation 124
De-encoding Hidden Source 124
Unparsing Code with B::Deparse 127
Perl::Critic 129
Creating My Own Perl::Critic Policy 132
Summary 133
Further Reading 134
7.Symbol Tables and Typeglobs 135
Package and Lexical Variables 135
Getting the Package Version 137
The Symbol Table 139
Typeglobs 141
Aliasing 144
Filehandle Arguments in Older Code 146
Naming Anonymous Subroutines 147
The Easy Way 148
Summary 149
Further Reading 150
8.Dynamic Subroutines 151
Subroutines as Data 151
Creating and Replacing Named Subroutines 155
Symbolic References 157
Iterating Through Subroutine Lists 159
Processing Pipelines 161
Self-Referencing Anonymous Subroutines 162
Method Lists 162
Subroutines as Arguments 163
Autoloaded Methods 167
Hashes as Objects 169
AutoSplit 170
Summary 171
Further Reading 171
9.Modifying and Jury-Rigging Modules 173
Choosing the Right Solution 173
Sending Patches to the Author 173
Local Patches 175
Taking Over a Module 175
Forking 176
Starting Over on My Own 176
Replacing Module Parts 176
Subclassing 179
An ExtUtils::MakeMaker Example 181
Other Examples 184
Wrapping Subroutines 184
Summary 186
Further Reading 186
10.Configuring Perl Programs 187
Things Not to Do 187
Code in a Separate File 189
Better Ways 190
Environment Variables 190
Special Environment Variables 191
Turning on Extra Output 191
Command-Line Switches 193
The-s Switch 194
Getopt Modules 195
Configuration Files 200
ConfigReader::Simple 200
Config::IniFiles 201
Config::Scoped 201
Other Configuration Formats 202
Scripts with a Different Name 202
Interactive and Noninteractive Programs 203
perl's Config 204
Different Operating Systems 205
Summary 206
Further Reading 206
11.Detecting and Reporting Errors 207
Perl Error Basics 207
Operating System Errors 208
Child Process Errors 210
Errors Specific to the Operating System 212
Reporting Module Errors 213
Separation of Concerns 213
Exceptions 215
eval 216
Multiple Levels of die 217
die with a Reference 218
Propagating Objects with die 220
Clobbering$@ 222
autodie 224
Reporting the Culprit 225
Catching Exceptions 229
Try::Tiny 229
TryCatch 231
Polymorphic Return Values 232
Summary 233
Further Reading 233
12.Logging 235
Recording Errors and Other Information 235
Log4perl 236
Subroutine Arguments 238
Configuring Log4perl 239
Persistent Configuration 243
Logging Categories 243
Other Log::Log4perl Features 245
Summary 247
Further Reading 247
13.Data Persistence 249
Perl-Specific Formats 249
pack 249
Fixed-Length Records 251
Unpacking Binary Formats 251
Data::Dumper 252
Similar Modules 256
Storable 258
Freezing Data 259
Storable's Security Problem 262
Sereal 264
DBM Files 269
dbmopen 270
DBM::Deep 270
Perl-Agnostic Formats 272
JSON 272
YAML 274
MessagePack 276
Summary 277
Further Reading 277
14.Working with Pod 279
The Pod Format 279
Directives 279
Encoding 281
Body Elements 281
Translating Pod 281
Pod Translators 282
Pod::Perldoc::ToToc 283
Pod::Simple 285
Subclassing Pod::Simple 288
Pod in Your Web Server 288
Testing Pod 288
Checking Pod 289
Pod Coverage 289
Hiding and Ignoring Functions 291
Summary 292
Further Reading 292
15.Working with Bits 293
Binary Numbers 293
Writing in Binary 294
Bit Operators 295
Unary NOT(~) 296
Bitwise AND (&) 298
Binary OR(|) 299
Exclusive OR(^) 300
Left<<and Right>>Shift Operators 302
Bit Vectors 302
The vec Function 304
Bit String Storage 306
Storing DNA 308
Checking Primes 309
Keeping Track of Things 311
Summary 312
Further Reading 312
16.The Magic of Tied Variables 313
They Look Like Normal Variables 313
At the User Level 314
Behind the Curtain 315
Scalars 316
Tie::Cycle 316
Bounded Integers 319
Self-Destructing Values 320
Arrays 321
Reinventing Arrays 322
Something a Bit More Realistic 325
Hashes 330
Filehandles 333
Summary 335
Further Reading 335
17.Modules as Programs 337
The main Thing 337
Backing Up 338
Who's Calling? 339
Testing the Program 340
Modules as Tests 340
Creating a Program Distribution 345
Adding to the Script 347
Distributing the Programs 352
Summary 352
Further Reading 353
A.Further Reading 355
B.brian's Guide to Solving Any Perl Problem 359
Index of Perl Modules in This Book 366
Index 369
- 《HTML5从入门到精通 第3版》(中国)明日科技 2019
- 《新手养花从入门到精通》徐帮学编 2019
- 《C语言从入门到精通》王征,李晓波著 2020
- 《可爱Q版技法从入门到精通》石头编著 2019
- 《WPS Office办公应用从入门到精通》IT新时代教育 2018
- 《行政管理实操从入门到精通》任康磊著 2020
- 《C#从入门到精通 第5版》(中国)明日科技 2019
- 《VRay渲染器及项目实战从入门到精通》沙旭,徐虹,乐美青编著 2019
- 《AutoCAD 2020从入门到精通 中文版》CADCAMCAE技术联盟 2019
- 《UGNX12入门、精通与实战 中文版》周敏 2019
- 《SQL与关系数据库理论》(美)戴特(C.J.Date) 2019
- 《魔法销售台词》(美)埃尔默·惠勒著 2019
- 《看漫画学钢琴 技巧 3》高宁译;(日)川崎美雪 2019
- 《优势谈判 15周年经典版》(美)罗杰·道森 2018
- 《社会学与人类生活 社会问题解析 第11版》(美)James M. Henslin(詹姆斯·M. 汉斯林) 2019
- 《海明威书信集:1917-1961 下》(美)海明威(Ernest Hemingway)著;潘小松译 2019
- 《迁徙 默温自选诗集 上》(美)W.S.默温著;伽禾译 2020
- 《上帝的孤独者 下 托马斯·沃尔夫短篇小说集》(美)托马斯·沃尔夫著;刘积源译 2017
- 《巴黎永远没个完》(美)海明威著 2017
- 《剑桥国际英语写作教程 段落写作》(美)吉尔·辛格尔顿(Jill Shingleton)编著 2019