Intermediate Perl

Intermediate Perl-Free PDF

  • Date:31 May 2020
  • Views:64
  • Downloads:0
  • Pages:280
  • Size:5.69 MB

Share Pdf : Intermediate Perl

Download and Preview : Intermediate Perl


Report CopyRight/DMCA Form For : Intermediate Perl


Transcription:

Intermediate Perl,Other Perl resources from O Reilly. Related titles Learning Perl Perl Best Practices,Programming Perl Perl Testing A Developer s. Advanced Perl Programming Notebook,Perl CD Bookshelf. Hacks Series Home hacks oreilly com is a community site for developers and power. users of all stripes Readers learn from each other as they share. their favorite tips and tools for Mac OS X Linux Google. Windows XP and more, Perl Books perl oreilly com is a complete catalog of O Reilly s books on Perl. Resource Center and related technologies including sample chapters and code. Perl com is the central web site for the Perl community It is the. perfect starting place for finding out everything there is to know. about Perl, Conferences O Reilly brings diverse innovators together to nurture the ideas.
that spark revolutionary industries We specialize in docu. menting the latest tools and systems translating the. innovator s knowledge into useful skills for those in the. trenches Visit conferences oreilly com for our upcoming events. Safari Bookshelf safari oreilly com is the premier online refer. ence library for programmers and IT professionals Conduct. searches across more than 1 000 books Subscribers can zero in. on answers to time critical questions in a matter of seconds. Read the books on your Bookshelf from cover to cover or sim. ply flip to the page you need Try it today for free. Intermediate Perl,Randal L Schwartz brian d foy and Tom Phoenix. Beijing Cambridge Farnham K ln Paris Sebastopol Taipei Tokyo. Intermediate Perl,by Randal L Schwartz brian d foy and Tom Phoenix. Copyright 2006 2003 O Reilly Media Inc All rights reserved. Printed in the United States of America, Published by O Reilly Media Inc 1005 Gravenstein Highway North Sebastopol CA 95472. O Reilly books may be purchased for educational business or sales promotional use Online editions. are also available for most titles safari oreilly com For more information contact our. corporate institutional sales department 800 998 9938 or corporate oreilly com. Editors Allison Randal and Tatiana Apandi Indexer Angela Howard. Production Editor Darren Kelly Cover Designer Karen Montgomery. Copyeditor Chris Downey Interior Designer David Futato. Proofreader Nancy Reinhardt Illustrators Robert Romano Jessamyn Read. and Lesley Borash,Printing History, June 2003 First Edition published as Learning Perl Objects References Modules. March 2006 Second Edition, Nutshell Handbook the Nutshell Handbook logo and the O Reilly logo are registered trademarks of.
O Reilly Media Inc Intermediate Perl the image of an alpaca and related trade dress are trademarks of. O Reilly Media Inc, Many of the designations used by manufacturers and sellers to distinguish their products are claimed as. trademarks Where those designations appear in this book and O Reilly Media Inc was aware of a. trademark claim the designations have been printed in caps or initial caps. While every precaution has been taken in the preparation of this book the publisher and authors. assume no responsibility for errors or omissions or for damages resulting from the use of the. information contained herein, This book uses RepKover a durable and flexible lay flat binding. ISBN 10 0 596 10206 2,ISBN 13 978 0 596 10206 7,Table of Contents. Foreword xi,Preface xiii,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 Scoping 34. 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. 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 References 63,Referencing a Named Subroutine 63.
Anonymous Subroutines 68,Callbacks 70,Closures 70,Returning a Subroutine from a Subroutine 72. vi Table of Contents,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 Transform 93. Multi Level Sort with the Schwartzian Transform 94. Recursively Defined Data 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 Objects 115. If We Could Talk to the Animals 115,Introducing the Method Invocation Arrow 117.
The Extra Parameter of Method Invocation 118,Table of Contents vii. 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,viii Table of Contents. 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,Exporting in a Primarily OO Module 166. Custom Import Routines 168,Exercises 169,16 Writing a Distribution 171. 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,Table of Contents ix,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,x Table of Contents.
Foreword 1, Perl s object oriented OO mechanism is classic prestidigitation It takes a collec. tion 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 con. jure 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 progres. sively fine tune OO Perl to meet your own needs by selecting from the existing con. structs the one that best suits your task, But there s a problem Since Perl co opts packages references hashes arrays sub. routines and modules as the basis for its OO mechanism to use OO Perl you. already need to understand packages references hashes arrays subroutines and. 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 bet. ter still he then goes on to show exactly how to combine those components to cre. ate useful classes and objects, So if you still feel like Gilligan when it comes to Perl s objects references and mod. ules this book is just what the Professor ordered,And that s straight from the horse s mouth.
Damian Conway May 2003,This is the Title of the Book eMatter Edition. Copyright 2008 O Reilly Associates Inc All rights reserved. Over a decade ago nearly eternity in Internet Time Randal Schwartz wrote the first. edition of Learning Perl In the intervening years Perl itself has grown substantially. from a cool scripting language used primarily by Unix system administrators to a. robust object oriented programming OOP language that runs on practically every. computing platform known to mankind, Throughout its four editions Learning Perl remained the same size about 300. pages and continued to cover much of the same material to remain compact and. accessible to the beginning programmer But there is much more to learn about Perl. now than when that first book was written, Randal called the first edition of this book Learning Perl Objects References and. Modules and now it s Intermediate Perl but we like to think of it as just Learning. More Perl This is the book that picks up where Learning Perl leaves off We show. you how to use Perl to write larger programs, As in Learning Perl we designed each chapter to be small enough to read in just an. hour or so Each chapter ends with a series of exercises to help you practice what. you ve just learned and the answers are in the appendix for your reference And like. Learning Perl we ve developed the material in this book for a teaching environment. and used it in that setting including for our own use at Stonehenge Consulting Ser. vices as we conduct on site and open enrollment trainings. You don t have to be a Unix guru or even a Unix user to benefit from this book. Unless otherwise noted everything in this book applies equally well to Windows. ActivePerl from ActiveState and all other modern implementations of Perl To use. this book you just need to be familiar with the material in Learning Perl and have. the ambition to go further, Don t ask why it isn t called that We must have had 300 emails on the subject Okay ask since we know.
you re going to anyway You never really stop learning Perl so Learning More Perl doesn t really tell you. much about the book Our editor chose the name which tells you what to expect. This is the Title of the Book eMatter Edition, Copyright 2008 O Reilly Associates Inc All rights reserved. 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

Related Books