Skip to Content
Higher-Order Perl
book

Higher-Order Perl

by Mark Jason Dominus
March 2005
Intermediate to advanced
600 pages
14h
English
Morgan Kaufmann
Content preview from Higher-Order Perl

CHAPTER 6 INFINITE STREAMS

There’s a special interface that we can put on iterators that makes them easier to deal with in many cases. One drawback of the iterators we’ve seen so far is that they were difficult or impossible to rewind; once data came out of them, there was no easy way to put it back again. Later on, in Chapter 8, we will want to scan forward in an input stream, looking for a certain pattern; if we don’t see it, we might want to rescan the same input, looking for a different pattern. This is inconvenient to do with the iterators of Chapter 4, but the variation in this chapter is just the thing, and we will use it extensively in Chapter 8.

What we need is a data structure more like an array or a list. We can make the iterators ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Beginning Perl

Beginning Perl

Curtis Ovid Poe
Think Perl 6

Think Perl 6

Laurent Rosenfeld, Allen B. Downey
Minimal Perl

Minimal Perl

Tim Maher
Perl by Example

Perl by Example

Ellie Quigley

Publisher Resources

ISBN: 9781558607019