|
|
| Syntactic Confectionery Delight | |
| PerlMonks |
Re: Your favorite objects NOT of the hashref phylumby nferraz (Monk) |
| on Mar 25, 2006 at 16:49 UTC ( [id://539233]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
I don't know if it's the kind of object you're looking for, but I'm very interested in interators:
The cool part is the way they can be created in Perl:
Now, you may be asking what's an iterator used for? Iterators can be used instead of arrays when the list in its entirety would use too much memory, or when the list is infinite. For example, the set of even numbers:
I know this is not the most sophisticated example, but you got the idea. If you want to learn more about iterators, this is a good start point: http://www.perl.com/pub/a/2005/06/16/iterators.html
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||