Intermediate Perl(影印版)
Intermediate Perl(影印版)
Randal L. Schwartz, brian d foy, Tom Phoenix
出版时间:2008年08月
页数:256
本书指导你从一个Perl爱好者变成一个Perl程序员。《Intermediate Perl》将教您如何把Perl作为编程语言来使用,而不仅只是作为一种脚本语言。

Perl是一种灵活多变、功能强大的编程语言,可以应用在从系统管理到网络编程再到数据库操作等很多方面。人们常说Perl让容易的事情变简单,让困难的事情变得可行。《Intermediate Perl》正是关于如何将技能从处理简单任务跃升到胜任困难任务的书籍。

本书提供对Perl中级编程优雅而仔细的介绍。由畅销书《学习Perl》的作者所著,本书提供了《学习Perl》没有涵盖的内容。

主题包括:
* 包和命名空间
* 引用和作用域
* 操作复杂数据结构
* 面向对象编程
* 编写和使用模块
* 测试Perl代码
* 为CPAN贡献代码

参照《学习Perl》的成功编排格式,本书的每一章都短小到可以在一到两个小时内读完,并在结束时提供一系列练习题帮助您实践刚刚学到的知识。使用本书,您只需熟悉《学习Perl》的内容并有更进一步学习的决心。

对于不同的人而言Perl是一种不同的语言。对于某些人而言,它只是快速编写脚本的工具,但对于另外的人来说,它就是一种功能完整的面向对象语言。Perl被应用在各种任务当中,从对文本文件进行快速全局替换,到计算需要数星期才能完成处理的海量复杂科学数据。您的使用决定Perl的面貌。但不论您将Perl应用在什么方面,本书都将帮助您让应用更加有效、高效和优雅。

《Intermediate Perl》是为了把Perl作为一种编程语言来学习,而不仅是为了写脚本而著。这本书把Perl爱好者变为Perl程序员。

“这是本多么闪耀夺目的Perl书籍啊……这本书为那些渴望提高技能或者提升职业生涯的Perl程序员填补了空白。更为重要的是,看这本书有一种向大师学习的感觉。”
——Russell J.T. Dyer, UnixReview.com
  1. Foreword
  2. Preface
  3. 1. Introduction
  4. What Should You Know Already?
  5. What About All Those Footnotes?
  6. What’s with the Exercises?
  7. What If I’m a Perl Course Instructor?
  8. 2. Intermediate Foundations
  9. List Operators
  10. Trapping Errors with eval
  11. Dynamic Code with eval
  12. Exercises
  13. 3. Using Modules
  14. The Standard Distribution
  15. Using Modules
  16. Functional Interfaces
  17. Selecting What to Import
  18. Object-Oriented Interfaces
  19. A More Typical Object-Oriented Module: Math::BigInt
  20. The Comprehensive Perl Archive Network
  21. Installing Modules from CPAN
  22. Setting the Path at the Right Time
  23. Exercises
  24. 4. Introduction to References
  25. Performing the Same Task on Many Arrays
  26. Taking a Reference to an Array
  27. Dereferencing the Array Reference
  28. Getting Our Braces Off
  29. Modifying the Array
  30. Nested Data Structures
  31. Simplifying Nested Element References with Arrows
  32. References to Hashes
  33. Exercises
  34. 5. References and Scoping
  35. More Than One Reference to Data
  36. What If That Was the Name?
  37. Reference Counting and Nested Data Structures
  38. When Reference Counting Goes Bad
  39. Creating an Anonymous Array Directly
  40. Creating an Anonymous Hash
  41. Autovivification
  42. Autovivification and Hashes
  43. Exercises
  44. 6. Manipulating Complex Data Structures
  45. Using the Debugger to View Complex Data
  46. Viewing Complex Data with Data::Dumper
  47. YAML
  48. Storing Complex Data with Storable
  49. Using the map and grep Operators
  50. Applying a Bit of Indirection
  51. Selecting and Altering Complex Data
  52. Exercises
  53. 7. Subroutine References
  54. Referencing a Named Subroutine
  55. Anonymous Subroutines
  56. Callbacks
  57. Closures
  58. Returning a Subroutine from a Subroutine
  59. Closure Variables as Inputs
  60. Closure Variables as Static Local Variables
  61. Exercise
  62. 8. Filehandle References
  63. The Old Way
  64. The Improved Way
  65. The Even Better Way
  66. IO::Handle
  67. Directory Handle References
  68. Exercises
  69. 9. Practical Reference Tricks
  70. Review of Sorting
  71. Sorting with Indices
  72. Sorting Efficiently
  73. The Schwartzian Multi-Level Sort with the Recursively Defined Data
  74. Building Recursively Defined Data
  75. Displaying Recursively Defined Data
  76. Exercises
  77. 10. Building Larger Programs
  78. The Cure for the Common Code
  79. Inserting Code with eval
  80. Using do
  81. Using require
  82. require and @INC
  83. The Problem of Namespace Collisions
  84. Packages as Namespace Separators
  85. Scope of a Package Directive
  86. Packages and Lexicals
  87. Exercises
  88. 11. Introduction to Objects
  89. If We Could Talk to the Animals
  90. Introducing the Method Invocation Arrow
  91. The Extra Parameter of Method Invocation
  92. Calling a Second Method to Simplify Things
  93. A Few Notes About @ISA
  94. Overriding the Methods
  95. Starting the Search from a Different Place
  96. The SUPER Way of Doing Things
  97. What to Do with @_
  98. Where We Are So Far
  99. Exercises
  100. 12. Objects with Data
  101. A Horse Is a Horse, of Course of Course—or Is It?
  102. Invoking an Instance Method
  103. Accessing the Instance Data
  104. How to Build a Horse
  105. Inheriting the Constructor
  106. Making a Method Work with Either Classes or Instances
  107. Adding Parameters to a Method
  108. More Interesting Instances
  109. A Horse of a Different Color
  110. Getting Our Deposit Back
  111. Don’t Look Inside the Box
  112. Faster Getters and Setters
  113. Getters That Double as Setters
  114. Restricting a Method to Class-Only or Instance-Only
  115. Exercise
  116. 13. Object Destruction
  117. Cleaning Up After Yourself
  118. Nested Object Destruction
  119. Beating a Dead Horse
  120. Indirect Object Notation
  121. Additional Instance Variables in Subclasses
  122. Using Class Variables
  123. Weakening the Argument
  124. Exercise
  125. 14. Some Advanced Object Topics
  126. UNIVERSAL Methods
  127. Testing Our Objects for Good Behavior
  128. AUTOLOAD as a Last Resort
  129. Using AUTOLOAD for Accessors
  130. Creating Getters and Setters More Easily
  131. Multiple Inheritance
  132. Exercises
  133. 15. Exporter
  134. What use Is Doing
  135. Importing with Exporter
  136. @EXPORT and @EXPORT_OK
  137. %EXPORT_TAGS
  138. Exporting in a Primarily OO Module
  139. Custom Import Routines
  140. Exercises
  141. 16. Writing a Distribution
  142. There’s More Than One Way To Do It
  143. Using h2xs
  144. Embedded Documentation
  145. Controlling the Distribution with Makefile.PL
  146. Alternate Installation Locations (PREFIX=...)
  147. Trivial make test
  148. Trivial make install
  149. Trivial make dist
  150. Using the Alternate Library Location
  151. Exercise
  152. 17. Essential Testing
  153. More Tests Mean Better Code
  154. A Simple Test Script
  155. The Art of Testing
  156. The Test Harness
  157. Writing Tests with Test::More
  158. Testing Object-Oriented Features
  159. A Testing To-Do List
  160. Skipping Tests
  161. More Complex Tests (Multiple Test Scripts)
  162. Exercise
  163. 18. Advanced Testing
  164. Testing Large Strings
  165. Testing Files
  166. Testing STDOUT or STDERR
  167. Using Mock Objects
  168. Testing POD
  169. Coverage Testing
  170. Writing Your Own Test::* Modules
  171. Exercises
  172. 19. Contributing to CPAN
  173. The Comprehensive Perl Archive Network
  174. Getting Prepared
  175. Preparing Your Distribution
  176. Uploading Your Distribution
  177. Announcing the Module
  178. Testing on Multiple Platforms
  179. Consider Writing an Article or Giving a Talk
  180. Exercise
  181. Appendix: Answers to Exercises .
  182. Index
书名:Intermediate Perl(影印版)
国内出版社:东南大学出版社
出版时间:2008年08月
页数:256
书号:978-7-5641-1235-6
原版书出版商:O'Reilly Media
Randal L. Schwartz
 
Randal L. Schwartz是软件工业界经历了两个时代的老战士。他精通软件设计、系统管理、安全、技术写作和培训。Randal与他人共同编著了许多已成为事实标准的“必备”书:《Programming Perl》、《Learning Perl》、《Learning Perl for Win32 Systems》和《Effective Perl Programming》,他还是杂志《WebTechniques》、《PerformanceComputing》、《SysAdmin》和《Linux》的专栏作家。他也是Perl新闻组的一位多产作者,并从comp.lang.perl.announce开始时就是它的管理员。他不落俗套的幽默和大师风范的技术在全世界范围内已经堪称传奇(不过可能他自己本身早就开始了这个传奇)。Randal回馈Perl社区的愿望促使他帮助成立了The Perl Institute,并提供了初始资金。他还是Perl Mongers(perl.org)创建理事会的成员,这是一个世界范围的Perl基层推广组织。从1985年起,Randal拥有并经营Stonehenge Consulting Services公司。Randal的联络方式是merlyn@stonehenge.com或(503)777-0095,欢迎广大读者与他共同探讨Perl的一些问题以及其他相关主题。








Randal L. Schwartz是一个电子零售商和企业家,靠软件设计、技术协作、系统管理、安全咨询和影像产品谋生。他以他的丰富的、幽默的和偶尔不正确的内容而闻名网络新闻组——特别是在comp.lang.perl上他的“Just another perl hacker”的签名。
Randal在Tektronix、ServioLogic和Sequent工作的7年磨练了许多技艺。在过去的 5年里,他在他的家乡奥勒冈州波特兰市已经开办并经营了Stonehenge Consulting Services
公司。







Randal L. Schwartz是一个电子零售商和企业家,靠软件设计、技术写作、系统管理、安全咨询和影像产品谋生。他以他的丰富的、幽默的和偶尔不正确的内容而闻名网络新闻组——特别是在comp.lang.perl上他的“Just another perl hacker”的签名。
Randal 在Tektronix、ServioLogic、和 Sequent工作的7年磨练了许多技艺。从1985年起,他在他的家乡奥勒冈州波特兰市已经开办并经营了Stonehenge Consulting Services公司。他是《Learning Perl》的作者和《Programming Perl》的作者之一,另外两位作者是Tom Christiansen 和Larry Wall——Perl的创始人。
Randal L. Schwartz is a renowned expert on the Perl programming language. In
addition to writing Learning Perl and the first two editions of Programming Perl, he
has been the Perl columnist for UNIX Review, Web Techniques, Sys Admin, and
Linux Magazine. He has contributed to a dozen Perl books and over 200 magazine
articles. Randal runs a Perl training and consulting company(Stonehenge Consulting
Services) and is highlysought after as a speaker for his combination of technical skill,
comedic timing, and crowd rapport. He’s also a pretty good Karaoke singer.
 
 
brian d foy
 
brian d foy是一个多产的Perl培训师和作家,他主办了“The Perl Review”,通过教育、咨询、代码审查等等帮助人们使用和了解Perl。他经常在Perl会议上发表演说。他是《Learning Perl》、《Intermediate Perl》和《Effective Perl Programming》的合作者,另外还单独著有《Mastering Perl》。1998年到2009年期间,他任职于Stonehenge Consulting Services担任讲师和作者。从他成为一个物理学研究生开始就是一个Perl用户,另外从他拥有自己的第一台计算机开始就是一个顽固的Mac用户。他成立了第一个Perl用户组(New York Perl Mongers),另外还创建了非盈利的Perl Mongers公司,帮助建立了全世界200多个Perl用户组。他维护着核心Perl文档的perlfaq部分,另外还维护着CPAN上的很多模块以及一些独立的脚本。
 
 
Tom Phoenix
 
Tom Phoenix自1982年起一直从事教育工作。他曾经在一个科学博物馆工作过13年以上,工作内容包括解剖、爆炸,还有可爱的动物、高压火花等。之后,从1996年起,他开始在Stonehenge Consulting Services讲授Perl课程。从那以后,他到过很多有趣的地方,因此也许你不久就会在一个Perl Mongers大会上见到他。一有时间,他就会在comp.lang.perl.misc和comp.lang.perl.moderated新闻组上回答问题,并致力于Perl的开发和利用。除了从事与Perl相关的工作、与Perl高手沟通及相关工作以外,Tom业余时间还从事密码学研究并练习世界语。他的家在俄勒冈的波特兰。
Tom Phoenix has been working in the field of education since 1982. After more than
13 years of dissections, explosions, work with interesting animals, and high-voltage
sparks during his work at a science museum, he started teaching Perl for Stonehenge
Consulting Services, where he’s worked since 1996. As it is traditional for Perl people
to have at least three other unlikely interests, Tom enjoys amateur cryptography,
Esperanto, and Squeak (Smalltalk). According to rumor, he has never turned down
an opportunityto playa game of Zendo. He lives in Portland, Oregon, with his wife
and cats.
 
 
The animal on the cover of Intermediate Perl is an alpaca (Lama pacos). The alpaca is
a member of the South American camelid family, which is closely related to the more
familiar Asian and African camels. South American camelids also include the llama,
the vicuna, and the guanaco. The alpaca is smaller (36 inches at the withers) than a
llama but larger than its other relations. Ninety-nine percent of the world’s approximately
three million alpacas are found in Peru, Bolivia, and Chile.
The evolution of the wild vicuna into the domestic alpaca began between six and
seven thousand years ago. The specialized breeding of alpacas for fiber production
wasn’t developed until around 500 B.C. The Incas developed the alpaca into the two
distinct fleece types, the Huacaya (pronounced wa-kai-ya) and the less common Suri.
The main difference between the two types of alpacas is the fiber they produce. The
Huacaya fleece has crimp or wave; the Suri fleece is silky and lustrous and has no
crimp. Alpacas are prized for their fleece, which is as soft as cashmere and warmer,
lighter, and stronger than wool. Alpaca fleece comes in more colors than that of any other fiber-producing animal (approximately22 basic colors with manyvariations
and blends).
The lifespan of the alpaca is about 20 years. Gestation is 11.5 months, producing one
offspring, or cria, every14 to 15 months. The alpaca is a modified ruminant, not
onlyeating less grass than most other animals but converting it to energyveryefficiently.
Unlike true ruminants, they have three compartments in their stomach, not
four, and can thus survive in areas unsuitable to other domesticated animals. Alpacas
are gentle and don’t bite or butt. Even if theydid, without incisors, horns, hoofs, or
claws, they would do little damage.