分享
 
 
 

Intermediate Perl(影印版)

Intermediate Perl(影印版)  点此进入淘宝搜索页搜索
  特别声明:本站仅为商品信息简介,并不出售商品,您可点击文中链接进入淘宝网搜索页搜索该商品,有任何问题请与具体淘宝商家联系。
  參考價格: 点此进入淘宝搜索页搜索
  分類: 图书,计算机与互联网,程序语言与软件开发,语言与开发工具,综合,
  品牌: 施瓦茨

基本信息·出版社:东南大学出版社

·页码:256 页

·出版日期:2008年

·ISBN:9787564112356

·条形码:9787564112356

·包装版本:1版

·装帧:平装

·开本:16

·正文语种:英语

产品信息有问题吗?请帮我们更新产品信息。

内容简介《Intermediate Perl》将教您如何把Perl作为编程语言来使用,而不仅只是作为一种脚本语言。

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

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

主题包括:

包和命名空间

引用和作用域

操作复杂数据结构

面向对象编程

编写和使用模块

测试Perl代码

为CPAN贡献代码

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

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

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

编辑推荐《Intermediate Perl》从一个Perl爱好者到一个Perl程序员。

目录

Foreword . xiii

Preface xv

1. Introduction 1

What Should You Know Already? 2

What About All Those Footnotes? 2

What’s with the Exercises? 2

What If I’m a Perl Course Instructor? 3

2. Intermediate Foundations 4

List Operators 4

Trapping Errors with eval 8

Dynamic Code with eval 9

Exercises 10

3. Using Modules 11

The Standard Distribution 11

Using Modules 12

Functional Interfaces 12

Selecting What to Import 13

Object-Oriented Interfaces 14

A More Typical Object-Oriented Module: Math::BigInt 15

The Comprehensive Perl Archive Network 15

Installing Modules from CPAN 16

Setting the Path at the Right Time 17

Exercises 19

4. Introduction to References 21

Performing the Same Task on Many Arrays 21

Taking a Reference to an Array 23

Dereferencing the Array Reference 24

Getting Our Braces Off 26

Modifying the Array 26

Nested Data Structures 27

Simplifying Nested Element References with Arrows 29

References to Hashes 30

Exercises 32

5. References and Scoping34

More Than One Reference to Data 34

What If That Was the Name? 35

Reference Counting and Nested Data Structures 36

When Reference Counting Goes Bad 38

Creating an Anonymous Array Directly 40

Creating an Anonymous Hash 42

Autovivification 44

Autovivification and Hashes 47

Exercises 48

6. Manipulating Complex Data Structures 50

Using the Debugger to View Complex Data 50

Viewing Complex Data with Data::Dumper 54

YAML 56

Storing Complex Data with Storable 57

Using the map and grep Operators 59

Applying a Bit of Indirection 59

Selecting and Altering Complex Data 60

Exercises 62

7. Subroutine References63

Referencing a Named Subroutine 63

Anonymous Subroutines 68

Callbacks 70

Closures 70

Returning a Subroutine from a Subroutine 72

Closure Variables as Inputs 75

Closure Variables as Static Local Variables 75

Exercise 77

8. Filehandle References. 79

The Old Way 79

The Improved Way 80

The Even Better Way 81

IO::Handle 82

Directory Handle References 86

Exercises 87

9. Practical Reference Tricks 89

Review of Sorting 89

Sorting with Indices 91

Sorting Efficiently 92

The Schwartzian Multi-Level Sort with the Recursively Defined ata 95

Building Recursively Defined Data 96

Displaying Recursively Defined Data 98

Exercises 99

10. Building Larger Programs 101

The Cure for the Common Code 101

Inserting Code with eval 102

Using do 103

Using require 105

require and @INC 106

The Problem of Namespace Collisions 109

Packages as Namespace Separators 110

Scope of a Package Directive 112

Packages and Lexicals 113

Exercises 113

11. Introduction to Objects115

If We Could Talk to the Animals... 115

Introducing the Method Invocation Arrow 117

The Extra Parameter of Method Invocation 118

Calling a Second Method to Simplify Things 119

A Few Notes About @ISA 120

Overriding the Methods 121

Starting the Search from a Different Place 123

The SUPER Way of Doing Things 124

What to Do with @_ 124

Where We Are So Far... 124

Exercises 125

12. Objects with Data 126

A Horse Is a Horse, of Course of Course—or Is It? 126

Invoking an Instance Method 127

Accessing the Instance Data 128

How to Build a Horse 128

Inheriting the Constructor 129

Making a Method Work with Either Classes or Instances ..130

Adding Parameters to a Method 131

More Interesting Instances 132

A Horse of a Different Color 133

Getting Our Deposit Back 133

Don’t Look Inside the Box 135

Faster Getters and Setters 136

Getters That Double as Setters 136

Restricting a Method to Class-Only or Instance-Only 137

Exercise 137

13. Object Destruction 139

Cleaning Up After Yourself 139

Nested Object Destruction 141

Beating a Dead Horse 144

Indirect Object Notation 145

Additional Instance Variables in Subclasses 147

Using Class Variables 149

Weakening the Argument 150

Exercise 152

14. Some Advanced Object Topics 154

UNIVERSAL Methods 154

Testing Our Objects for Good Behavior 155

AUTOLOAD as a Last Resort 156

Using AUTOLOAD for Accessors 157

Creating Getters and Setters More Easily 158

Multiple Inheritance 160

Exercises 161

15. Exporter 162

What use Is Doing 162

Importing with Exporter 163

@EXPORT and @EXPORT_OK 164

%EXPORT_TAGS 165

xporting in a Primarily OO Module 166

Custom Import Routines 168

Exercises 169

16. Writing a Distribution171

There’s More Than One Way To Do It 172

Using h2xs 173

Embedded Documentation 179

Controlling the Distribution with Makefile.PL 183

Alternate Installation Locations (PREFIX=...) 184

Trivial make test 185

Trivial make install 186

Trivial make dist 186

Using the Alternate Library Location 187

Exercise 188

17. Essential Testing 189

More Tests Mean Better Code 189

A Simple Test Script 190

The Art of Testing 191

The Test Harness 193

Writing Tests with Test::More 195

Testing Object-Oriented Features 197

A Testing To-Do List 199

Skipping Tests 200

More Complex Tests (Multiple Test Scripts) 201

Exercise 201

18. Advanced Testing . 203

Testing Large Strings 203

Testing Files 204

Testing STDOUT or STDERR 205

Using Mock Objects 208

Testing POD 209

Coverage Testing 210

Writing Your Own Test::* Modules 211

Exercises 214

19. Contributing to CPAN. 216

The Comprehensive Perl Archive Network 216

Getting Prepared 216

Preparing Your Distribution 217

Uploading Your Distribution 218

Announcing the Module 219

Testing on Multiple Platforms 219

Consider Writing an Article or Giving a Talk 220

Exercise 220

Appendix: Answers to Exercises 221

Index ... 249

……[看更多目录]

序言Perl’s object-oriented (OO) mechanism is classic prestidigitation. It takes a collection of Perl’s existing non-OO features, such as packages, references, hashes, arrays, subroutines, and modules, and then—with nothing up its sleeve—manages to conjure up fully functional objects, classes, and methods, seemingly out of nowhere. .

That’s a great trick. It means you can build on your existing Perl knowledge and ease your way into OO Perl development, without first needing to conquer a mountain of new syntax or navigate an ocean of new techniques. It also means you can progressively fine-tune OO Perl to meet your own needs, by selecting from the existing constructs the one that best suits your task.

But there’s a problem. Since Perl co-opts packages, references, hashes, arrays, subroutines, and modules as the basis for its OO mechanism, to use OO Perl you already need to understand packages, references, hashes, arrays, subroutines, and modules. ..

And there’s the rub. The learning curve hasn’t been eliminated; it’s merely been pushed back half a dozen steps.

So then, how are you going to learn everything you need to know about non-OO Perl so you can start to learn everything you need to know about OO Perl?

This book is the answer. In the following pages, Randal draws on two decades of using Perl, and four decades of watching Gilligan’s Island and Mr. Ed, to explain each of the components of Perl that collectively underpin its OO features. And, better still, he then goes on to show exactly how to combine those components to create useful classes and objects.

文摘插图:

Intermediate Perl(影印版)

 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有