I only see one definition of Iterator in your code - and it's outcommented. Essentially, "Iterator" is a noop, but because Perl allows you to leave off the 'sub' keyword if the first argument of a subroutine has prototype '&' (as here), the code is allowed to write: