Har du läst boken? Bli först att betygsätta och recensera boken .
- Inbunden (Cloth)
- Språk: Engelska
- Antal sidor: 540
- Utg.datum: 2004-12-01
- Medarbetare: JasonDominus, Mark
- Illustrationer: Ill.
- Dimensioner: 240 x 194 x 34 mm
- Vikt: 1190 g
- Antal komponenter: 1
- Komponenter: 3:B&W 7.5 x 9.25 in or 235 x 191 mm Perfect Bound on White w/Gloss Lam
- ISBN: 9781558607019
Recensioner i media
Higher-Order Perl is the most exciting, most clearly-written, most comprehensive, and most forward-looking programming book I've read in at least ten years. It's your map to the future of programming in any language. - Sean M. Burke, Leading Programmer, Comprehensive Perl Archive Network (CPAN) There are lots of book that teach you new Perl modules or techniques. This book goes beyond that and teaches a new way to think about Perl programming. - Peter Norvig, Google Inc. As a programmer, your bookshelf is probably overflowing with books that did nothing to change the way you program... or think about programming. You're going to need a completely different shelf for this book. While discussing caching techniques in Chapter 3, Mark Jason Dominus points out how a large enough increase in power can change the fundamental way you think about a technology. And that's precisely what this entire book does for Perl. It raids the deepest vaults and highest towers of Computer Science, and transforms the many arcane treasures it finds--recursion, iterators, filters, memoization, partitioning, numerical methods, higher-order functions, currying, cutsorting, grammar-based parsing, lazy evaluation, and constraint programming--into powerful and practical tools for real-world programming tasks: file system interactions, HTML processing, database access, web spidering, typesetting, mail processing, home finance, text outlining, and diagram generation. Along the way it also scatters smaller (but equally invaluable) gems, like the elegant explanation of the difference between 'scope' and 'duration' in Chapter 3, or the careful exploration of how best to return error flags in Chapter 4. It even has practical tips for Perl evangelists. Dominus presents even the most complex ideas in simple, comprehensible ways, but never compromises on the precision and attention to detail for which he is so widely and justly admired. His writing is - as always - lucid, eloquent, witty, and compelling. Aptly named, this truly is a Perl book of a higher order, and essential reading for every serious Perl programmer. - Damian Conway, Co-designer of Perl 6
By Mark-Jason Dominus
1. Recursion and Callbacks; 1.1 Decimal to Binary Conversion; 1.2 Factorial; 1.2.1 Why Private Variables are Important; 1.3 The Tower of Hanoi; 1.4 Hierarchical Data; 1.5 Applications and Variations of Directory Walking; 1.6 Functional vs. Object-Oriented Programming; 1.7 HTML; 1.7.1 More Flexible Selection; 1.8 When Recursion Blows Up; 1.8.1 Fibonacci Numbers; 1.8.2 Partitioning; 2. Dispatch Tables; 2.1 Configuration File Handling; 2.1.1 Table-driven configuration; 2.1.2 Advantages of Dispatch Tables; 2.1.3 Dispatch Table Strategies; 2.1.4 Default Actions; 2.2 Calculator; 2.2.1 HTML Processing Revisited; 3. Caching and Memoization; 3.1 Caching Fixes Recursion; 3.2 Inline Caching; 3.2.1 Static Variables; 3.3 Good Ideas; 3.4 Memoization; 3.5 The Memoize Module; 3.5.1 Scope and Duration; 126.96.36.199 Scope; 188.8.131.52 Duration; 3.5.2 Lexical Closure; 3.5.3 Memoization Again; 3.6 Caveats; 3.6.1 Functions whose Return Values do not Depend on their Arguments; 3.6.2 Functions with Side Effects; 3.6.3 Functions that Return References; 3.6.4 A Memoized Clock?; 3.4.5 Very Fast Functions; 3.7 Key Generation; 3.7.1 More Applications of User-Supplied Key Generators; 3.7.2 Inlined Cache Manager with Argument Normalizer; 3.7.3 Functions with Reference Arguments; 3.7.4 Partioning; 3.7.5 Custom Key Generation for Impure Functions; 7.8 Caching in Object Methods; 3.8.1 Memoization of Object Methods; 3.9 Persistent Caches; 3.10 Alternatives to Memoization; 3.11 Evangelism; 3.12 The Benefits of Speed; 3.12.1 Profiling and Performance Analysis; 3.12.2 Automatic Profiling; 3.12.3 Hooks; 4. Iterators; 4.1 Introduction; 4.1.1 Filehandles are Iterators; 4.1.2 Iterators are Objects; 4.1.3 Other Common Examples of Iterators; 4.2 Homemade Iterators; 4.2.1 A Trivial Iterator: ; 184.108.40.206 Syntactic Sugar for Manufacturing Iterators; 4.2.2 dir_walk(); 4.2.3 On Clever Inspirations; 4.3 Examples; 4.3.1 Permutations; 4.3.2 Genomic Sequence Generator; 4.3.3 Filehandle Iterators; 4.3.4 A Flat-File Database; 220.127.116.11 Improved Database; 4.3.5 Searching Databases Backwards; 18.104.22.168 A Query Package that Transforms Iterators; 22.214.171.124 An Iterator that Reads Files Backwards; 126.96.36.199 Putting it Together; 4.3.6 Random Number Generation; 4.4 Filters and Transforms; 4.5 The Semipredicate Problem; 4.5.1 Avoiding the Problem; 4.5.2 Alternative undefs; 4.5.3 Rewriting Utilities; 4.5.4 Iterators that Return Mulitple Values; 4.5.5 Explicit Exhaustion Function; 4.5.6 Four-Operation Iterators; 4.5.7 Iterator Methods; 4.6 Alternative Interfaces to Iterators; 4.6.1 Using foreach to Loop over more than one Array; 4.6.2 An Iterator with an each-like Interface; 4.6.3 Tied Variable Interfaces; 188.8.131.52 Summary of tie; 184.108.40.206 Tied Scalars; 220.127.116.11 Tied Filehandle; 4.7 An Extended Example: Web Spiders; 4.7.1 Pursuing only Interesting Links; 4.7.2 Referring URLs; 4.7.3 robots.txt; 4.7.4 Summary; 5. From Recursion to Iterators; 5.1 The Partition Problem Revisited; 5.1.1 Finding All Possible Partions; 5.1.2 Optimizations; 5.1.3 Variations; 5.2 How to Convert a Recursive Function to an Iterator; 5.3 A Generic Search Iterator; 5.4 Other General Techniques for Eliminating Recursion; 5.4.1 Tail Call Elimination; 18.104.22.168 Someone Else's Problem; 22.214.171.124 Creating Tail Calls; 126.96.36.199 Explicit Stacks; 188.8.131.52.1 Eliminating Recursion from fib(); 6. Infinite Streams; 6.1 Linked Lists; 6.2 Lazy Linked Lists; 6.2.1 A Trivial Stream: upto(); 6.2.2 Utilities for Streams; 6.3 Recursive Streams; 6.3.1 Memoizing Streams; 6.4 The Hamming Problem; 6.5 Regex String Generation; 6.5.1 Generating Strings in Order; 6.5.2 Regex Matching; 6.5.3 Cutsorting; 184.108.40.206 Log Files; 6.6 The Newton-Raphson Method; 6.6.1 Approximation Streams; 6.6.2 Derivatives; 6.6.3 The Tortoise and the Hare; 6.6.4 Finance; 6.7 Power Series; 6.7.1 Derivatives; 6.7.2 Other Functions; 6.7.3 Symbolic Computation; 7. Higher-Order Functions and Currying; 7.1 Currying; 7.2 Common Higher-Order Functions; 7.2.1 Automatic Currying; 7.2.2 Prototypes; 220.127.116.11 Pro