A Continental Perl Adventure Day One 12 of 96 : [PREV] [NEXT]

What is an iterator?

An iterator is a simple looping mechanism that can repeat a process across some data structure.

This a simple explanation, as iterators can get very complex. Mark's explanation is:

  • An iterator is an object interface to a list
  • It keeps track of the 'current position' in the list
  • It has a method for advancing to the next item in the list

What we are actually refering to here is closures.


© 2003 Barbie barbie@missbarbell.co.uk Home http://birmingham.pm.org/