Higher-Order Perl

Chapter 4: Iterators

Table of Contents

  1. Introduction
    1. Filehandles are Iterators
    2. Iterators are Objects
    3. Other Common Examples of Iterators
  2. Homemade iterators
    1. A Trivial Iterator: upto
      • Syntactic Sugar for Manufacturing Iterators
    2. dir_walk
    3. On Clever Inspirations
  3. Examples
    1. Permutations
    2. Genomic Sequence Generator
    3. Filehandle Iterators
    4. A Flat-File Database
      • Improved Database
    5. Searching Databases Backwards
      1. A Query Package that Transforms Iterators
      2. An Iterator that Reads Files Backwards
      3. Putting it Together
    6. Random Number Generation
  4. Filters and Transforms
    1. imap
    2. igrep
    3. list_iterator
    4. append
  5. The Semipredicate Problem
    1. Avoiding the Problem
    2. Alternative undefs
    3. Rewriting Utilities
    4. Iterators That Return Multiple Values
    5. Explicit Exhaustion Function
    6. Four-Operation Iterators
    7. Iterator Methods
  6. Alternative Interfaces to Iterators
    1. Using foreach to Loop Over More Than One Array
    2. An Iterator with an each-like Interface
    3. Tied Variable Interfaces
      1. Summary of tie
      2. Tied Scalars
      3. Tied Filehandle
  7. An Extended Example: Web Spiders
    1. Pursuing only Interesting Links
    2. Referring URLs
    3. robots.txt
    4. Summary

22575 words / 71 pages. (Last update Sun Nov 7 23:38:54 2004)

Chapter 3 | Chapter 5 | TOP

Order Higher-Order Perl online from Barnes & Noble

Subscribe to low-volume announcements-only mailing list:

Your email address:


Return to: Universe of Discourse main page | What's new page | Perl Paraphernalia | Higher-Order Perl

mjd-perl-hop+@plover.com