menu 简单麦麦
account_circle

最小珍珠:为Unix和Linux人-Minimal Perl: For UNIX and Linux People

帮助2597人找到了他们想要的文件
上传于 2020-02-28 24次下载 5231次围观
文件编号:1871
文件详情
标题(title):Minimal Perl: For UNIX and Linux People
最小珍珠:为Unix和Linux人
作者(author):Tim Maher
出版社(publisher):Manning
大小(size):9 MB (9611953 bytes)
格式(extension):pdf
注意:如果文件下载完成后为无法打开的格式,请修改后缀名为格式对应后缀

A guide to a carefully designed subset of the Perl language, this book makes Perl more accessible to those having UNIX/Linux skill levels ranging from elementary to expert by capitalizing on their existing knowledge of important utilities (grep, awk), or essential concepts (filters, command substitution, looping). Dozens of detailed programming examples are shown, drawn from contemporary application areas such as system administration, networking, Web development, databases, finance, HTML, CGI, and text analysis. Broken into two parts, the first is for all who are familiar with core UNIX/Linux commands such as grep and caters to readers ranging from managers and administrative staff to advanced programmers. The second part is for developers experienced in Bourne, Korn, Bash, or POSIX Shell programming and makes Perl scripting easy to learn by showing Shell examples along with their Perl counterparts. Many Perl modules are covered including freely available pre-written code from the CPAN.
Table of contents :
brief contents......Page 5
contents......Page 6
foreword......Page 14
preface......Page 15
acknowledgments......Page 18
Audience and organization......Page 19
Reference value......Page 20
Entertainment value......Page 21
Essential terminology......Page 22
Constant width......Page 23
Markup for highlighting and cross-referencing......Page 24
Displays of commands or code with output......Page 25
Perl code-with-output displays......Page 26
Shell programs......Page 27
Errata......Page 28
About the authors......Page 29
about the cover illustration......Page 30
tables......Page 31
Part 1 Minimal Perl: for UNIX and Linux Users......Page 34
1.1 A visit to Perlistan......Page 36
1.1.1 Sometimes you need a professional guide......Page 38
1.3 About Minimal Perl......Page 40
1.3.2 What Minimal Perl is......Page 41
1.4 Laziness is a virtue......Page 42
1.5.1 Terminating statements with semicolons......Page 43
1.6 Writing one-line programs......Page 44
1.6.2 Implementing simple filters......Page 45
1.7 Summary......Page 47
chapter 2 Perl essentials......Page 49
2.1 Perl’s invocation options......Page 50
2.1.2 Enabling warnings: -w......Page 51
2.1.4 Processing input with automatic printing: -p......Page 52
2.1.5 Processing line-endings: -l......Page 53
2.1.6 Printing without newlines: printf......Page 54
2.1.7 Changing the input record separator: -0digits......Page 55
2.2.1 Using special variables......Page 56
2.2.3 Using the record-number variable: $.......Page 57
2.2.4 Employing user-defined variables......Page 58
2.3 Loading modules: -M......Page 60
2.4 Writing simple scripts......Page 62
2.4.1 Quoting techniques......Page 63
2.4.3 Handling switches: -s......Page 65
2.4.4 Using warn and die......Page 68
2.4.5 Using logical and, logical or......Page 70
2.4.6 Programming with BEGIN and END blocks......Page 72
2.4.7 Loading modules with use......Page 74
2.5.1 Employing I/O variables......Page 75
2.5.2 Exploiting formatting variables......Page 76
2.6 Standard option clusters......Page 77
2.6.1 Using aliases for common types of Perl commands......Page 79
2.7 Constructing programs......Page 80
2.7.1 Constructing an output-only one-liner......Page 82
2.7.2 Constructing an input/output script......Page 83
Directions for further study......Page 84
3.1 A brief history of grep......Page 86
3.2.1 Uncertain support for metacharacters......Page 87
3.2.2 Lack of string escapes for control characters......Page 89
3.2.3 Comparing capabilities of greppers and Perl......Page 90
3.3 Working with the matching operator......Page 93
3.3.1 The one-line Perl grepper......Page 94
3.4 Understanding Perl’s regex notation......Page 96
3.6 Displaying the match only, using $&......Page 97
3.7 Displaying unmatched records (like grep -v)......Page 98
3.7.1 Validating data......Page 99
3.8 Displaying filenames only (like grep -l)......Page 100
3.9 Using matching modifiers......Page 101
3.10 Perl as a better egrep......Page 103
3.10.1 Working with cascading filters......Page 105
3.11.1 Paragraph mode......Page 108
3.12 Spanning lines with regexes......Page 110
3.12.1 Matching across lines......Page 112
3.12.3 Filtering lwp-request output......Page 113
3.13.1 Log-file analysis......Page 114
3.13.2 A scripted grepper......Page 117
3.13.3 Fuzzy matching......Page 118
3.14 Summary......Page 119
Directions for further study......Page 121
4.1 A brief history of sed......Page 122
4.2 Shortcomings of sed......Page 124
4.3 Performing substitutions......Page 126
4.3.2 Performing line-specific substitutions: Perl......Page 129
4.3.3 Performing record-specific substitutions: Perl......Page 130
4.3.4 Using backreferences and numbered variables in substitutions......Page 132
4.4.2 Printing lines by number: Perl......Page 133
4.5 Modifying templates......Page 134
4.6 Converting special characters......Page 136
4.7.1 Editing with commands......Page 138
4.7.2 Editing with scripts......Page 140
4.7.3 Safeguarding in-place editing......Page 144
4.8.1 Quieting spam......Page 146
4.9.1 Converting miles to kilometers......Page 147
4.9.2 Substitutions using function results......Page 149
4.11 Summary......Page 151
Directions for further study......Page 153
chapter 5 Perl as a (better) awk command......Page 154
5.1 A brief history of AWK......Page 155
5.2 Comparing basic features of awk and Perl......Page 156
5.2.1 Pattern-matching capabilities......Page 157
5.2.2 Special variables......Page 159
5.2.3 Perl’s variable interpolation......Page 161
5.2.5 Summary of differences in basic features......Page 162
5.3.1 Accessing fields......Page 163
5.3.2 Printing fields......Page 165
5.3.3 Differences in syntax for print......Page 167
5.3.4 Using custom field separators in Perl......Page 169
5.4 Programming with Patterns and Actions......Page 171
5.4.1 Combining pattern matching with field processing......Page 175
5.4.2 Extracting data from tables......Page 176
5.4.3 Accessing cell data using array indexing......Page 178
5.5 Matching ranges of records......Page 184
5.5.1 Operators for single- and multi-record ranges......Page 185
5.5.2 Matching a range of dates......Page 186
5.5.3 Matching multiple ranges......Page 188
5.6.1 Relational operators......Page 190
5.6.2 Arithmetic operators......Page 191
5.7 Using built-in functions......Page 192
5.7.1 One-liners that use functions......Page 194
5.7.2 The legend of nexpr......Page 195
5.7.3 How the nexpr* programs work......Page 197
5.8.1 Computing compound interest: compound_interest......Page 198
5.8.2 Conditionally pluralizing nouns: compound_interest2......Page 199
5.8.3 Analyzing log files: scan4oops......Page 201
5.10 Summary......Page 208
Directions for further study......Page 210
chapter 6 Perl as a (better) find command......Page 211
6.2 File testing capabilities of find vs. Perl......Page 213
6.2.1 Augmenting find with Perl......Page 216
6.3.1 Finding files by name matching......Page 217
6.3.2 Finding files by pathname matching......Page 220
6.4 Processing filename arguments......Page 221
6.4.1 Defending against grep’s messes......Page 222
6.4.2 Recursive grepping......Page 224
6.5 Using find | xargs vs. Perl alternatives......Page 225
6.5.1 Using Perl for reliable timestamp sorting......Page 226
6.5.2 Dealing with multi-word filenames......Page 229
6.6 find as an argument pre-processor for Perl......Page 230
6.7.1 Making the most of find2perl......Page 231
6.7.2 Helping non-Unix friends with find2perl......Page 232
6.8 Summary......Page 233
Directions for further study......Page 234
Part 2 Minimal Perl: for UNIX and Linux Shell Programmers......Page 235
chapter 7 Built-in functions......Page 237
7.1 Understanding and managing evaluation context......Page 238
7.1.1 Determinants and effects of evaluation context......Page 239
7.1.2 Making use of evaluation context......Page 240
7.2 Programming with functions that generate or process scalars......Page 242
7.2.1 Using split......Page 243
7.2.2 Using localtime......Page 246
7.2.3 Using stat......Page 247
7.2.4 Using chomp......Page 251
7.2.5 Using rand......Page 253
7.3.1 Comparing Unix pipelines and Perl functions......Page 255
7.3.2 Using sort......Page 256
7.3.3 Using grep......Page 259
7.3.4 Using join......Page 261
7.3.5 Using map......Page 264
7.4 Globbing for filenames......Page 266
7.4.1 Tips on globbing......Page 269
7.5 Managing files with functions......Page 271
7.5.1 Handling multi-valued return codes......Page 272
7.6.1 Controlling argument-gobbling functions......Page 274
7.7 Summary......Page 275
Directions for further study......Page 277
chapter 8 Scripting techniques......Page 279
8.1 Exploiting script-oriented functions......Page 280
8.1.1 Defining defined......Page 281
8.1.2 Exiting with exit......Page 285
8.1.3 Shifting with shift......Page 286
8.2.1 Accommodating non-filename arguments with implicit loops......Page 288
8.2.2 Filtering arguments......Page 289
8.3 Executing code conditionally with if/else......Page 291
8.3.1 Employing if/else vs. and/or......Page 292
8.3.2 Mixing branching techniques: The cd_report script......Page 293
8.3.3 Tips on using if/else......Page 296
8.4 Wrangling strings with concatenation and repetition operators......Page 297
8.4.2 Using concatenation and repetition operators together......Page 299
8.4.3 Tips on using the concatenation operator......Page 300
8.5 Interpolating command output into source code......Page 301
8.5.1 Using the tput command......Page 303
8.5.2 Grepping recursively: The rgrep script......Page 305
8.5.3 Tips on using command interpolation......Page 306
8.6 Executing OS commands using system......Page 307
8.6.1 Generating reports......Page 309
8.6.2 Tips on using system......Page 312
8.7 Evaluating code using eval......Page 315
8.7.1 Using a Perl shell: The psh script......Page 316
8.7.2 Appreciating a
付费内容
登录后即可获得
一个下载链接

常见问题

  • question_answer
    解压密码,提取码在哪?
    keyboard_arrow_down
    • 均在下载旁边哦,请注意查看,如果没有则是不需要密码
  • question_answer
    文件不符合描述怎么办?
    keyboard_arrow_down
    • 如果有文件问题,可以通过 卖家联系方式 联系卖家,如果 联系不上卖家 或 卖家无法解决 则可以在24小时内在我的订单页面申请售后
  • question_answer
    其他
    keyboard_arrow_down
    • 3.本文件为公益分享,文件由网上采集而来,如有侵权等问题,请及时联系客服删除
      常见问题及官方客服联系方式:点击前往
      售后问题处理方式:点击前往
登陆后下载
微信扫码支付
最小珍珠:为Unix和Linux人-Minimal Perl: For UNIX and Linux People
支付金额: 共计:¥0.0

添加收藏

创建新合集

-到底部了哦-